Skip to content

Commit 3fa1b03

Browse files
committed
Moved error.py, deleted "error" folder w/ ClientError (unused)
1 parent 93b9b70 commit 3fa1b03

5 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎blockscore/error/__init__.py‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎blockscore/error/client_error.py‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎blockscore/http_client/__init__.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
from .request_handler import RequestHandler
1212
from .response import Response
1313
from .response_handler import ResponseHandler
14+
from ..error import BlockscoreError
1415

1516
# Main HttpClient which is used by Api classes
1617
class HttpClient():
1718

1819
def __init__(self, auth, options):
1920

2021
self.options = {
21-
'base': 'https://api.blockscore.com/',
22+
#'base': 'https://api.blockscore.com/',
23+
'base': 'http://localhost:3000',
2224
'user_agent': 'blockscore-python/1.0.0 (https://github.com/BlockScore/blockscore-python)'
2325
}
2426

@@ -108,7 +110,12 @@ def create_request(self, method, path, options):
108110
if 'response_type' in options:
109111
del options['response_type']
110112

111-
return requests.request(method, path, **options)
113+
try:
114+
response = requests.request(method, path, **options)
115+
except BlockscoreError as e:
116+
raise
117+
118+
return response
112119

113120
# Get response body in correct format
114121
def get_body(self, response):

‎blockscore/http_client/error_handler.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from ..error import ClientError
2-
from ..error.error import BlockscoreError, AuthorizationError, \
1+
from ..error import BlockscoreError, AuthorizationError, \
32
InternalServerError, ValidationError, ParameterError, NotFoundError
43
from .response_handler import ResponseHandler
54

0 commit comments

Comments
 (0)