Skip to content

Commit 65f2baa

Browse files
authored
Merge branch 'main' into auth-session-support
2 parents 24390ef + 859131b commit 65f2baa

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 1.0.3 - 2022-08-07
2+
3+
* Fixes an issue with errors not being reported correctly.
4+
15
### 1.0.2 - 2022-05-02
26

37
* Fixes an issue with sessions not respecting proxy settings.

nasdaqdatalink/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ def handle_api_error(cls, resp):
108108

109109
# if our app does not form a proper data_link_error response
110110
# throw generic error
111-
if 'error' not in error_body:
111+
if 'quandl_error' not in error_body:
112112
raise DataLinkError(http_status=resp.status_code, http_body=resp.text)
113113

114-
code = error_body['error']['code']
115-
message = error_body['error']['message']
114+
code = error_body['quandl_error']['code']
115+
message = error_body['quandl_error']['message']
116116
prog = re.compile('^QE([a-zA-Z])x')
117117
if prog.match(code):
118118
code_letter = prog.match(code).group(1)

nasdaqdatalink/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.0.2'
1+
VERSION = '1.0.3'

test/test_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_nasdaqdatalink_exceptions_no_retries(self, request_method):
3636
httpretty.register_uri(getattr(httpretty, request_method),
3737
"https://data.nasdaq.com/api/v3/databases",
3838
responses=[httpretty.Response(body=json.dumps(
39-
{'error':
39+
{'quandl_error':
4040
{'code': x[0], 'message': 'something went wrong'}}),
4141
status=x[1]) for x in data_link_errors]
4242
)

test/test_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def test_bulk_download_raises_exception_when_error_response(self):
179179
re.compile(
180180
'https://data.nasdaq.com/api/v3/databases/*'),
181181
body=json.dumps(
182-
{'error':
182+
{'quandl_error':
183183
{'code': 'QEMx01', 'message': 'something went wrong'}}),
184184
status=500)
185185

test/test_datatable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_bulk_download_table_raises_exception_when_error_response(self, request_
186186
ApiConfig.number_of_retries = 2
187187
error_responses = [httpretty.Response(
188188
body=json.dumps(
189-
{'error': {'code': 'QEMx01', 'message': 'something went wrong'}}
189+
{'quandl_error': {'code': 'QEMx01', 'message': 'something went wrong'}}
190190
),
191191
status=500)]
192192

test/test_retries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def setUpClass(cls):
3939

4040
cls.error_response = httpretty.Response(
4141
body=json.dumps(
42-
{'error': {'code': 'QEMx01', 'message': 'something went wrong'}}
42+
{'quandl_error': {'code': 'QEMx01', 'message': 'something went wrong'}}
4343
),
4444
status=500)
4545
cls.success_response = httpretty.Response(body=json.dumps(cls.datatable), status=200)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy