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