mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2026-02-23 12:12:32 +01:00
Log HTTP Response Error Message on failed requests
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import logging
|
||||||
import requests
|
import requests
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
@@ -50,6 +52,7 @@ class RestClient(object):
|
|||||||
try:
|
try:
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
|
logging.error(resp.content)
|
||||||
raise RestClientError(e)
|
raise RestClientError(e)
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
Reference in New Issue
Block a user