diff --git a/upbit/pkginfo.py b/upbit/pkginfo.py index fba880f..335863a 100644 --- a/upbit/pkginfo.py +++ b/upbit/pkginfo.py @@ -29,7 +29,7 @@ def _get_versions(package_name): PACKAGE_NAME = 'upbit-client' OPEN_API_VERSION = '1.2.0' -CURRENT_VERSION = OPEN_API_VERSION+'.2' +CURRENT_VERSION = OPEN_API_VERSION+'.3' RELEASED_VERSION = _get_versions(PACKAGE_NAME) LATEST_VERSION = RELEASED_VERSION[0] diff --git a/upbit/utils.py b/upbit/utils.py index 69e4cd0..66898ba 100644 --- a/upbit/utils.py +++ b/upbit/utils.py @@ -27,12 +27,34 @@ def remaining_request(headers: dict) -> dict: def future_extraction(http_future) -> dict: resp = http_future.future.result() remaining = HTTPFutureExtractor.remaining_request(resp.headers) + # resp.raise_for_status() - return { + + result = { "remaining_request": remaining, - "result": resp.json() + "response": { + "url": resp.url, + "headers": resp.headers, + "status_code": resp.status_code, + "reason": resp.reason, + "text": resp.text, + "content": resp.content, + "ok": resp.ok + } } + try: + result['result'] = resp.json() + except: + result['result'] = { + "error": { + "message": resp.text, + "name": resp.reason + } + } + finally: + return result + class Validator: