88 'InternalError' : 500
99}
1010
11- # Exceptions
11+ # Generic Exception
1212class BlockscoreError (Exception ):
1313
1414 def __init__ (self , message = None , json_body = None , http_status = None ,
@@ -21,6 +21,7 @@ def __init__(self, message=None, json_body=None, http_status=None,
2121 self .json_body = json_body
2222
2323
24+ # Input could not be validated.
2425class ValidationError (BlockscoreError ):
2526
2627 def __init__ (self , message = None , json_body = None , param = None ,
@@ -36,6 +37,7 @@ def __init__(self, message=None, json_body=None, param=None,
3637 self .param = param
3738
3839
40+ # Required parameter missing
3941class ParameterError (BlockscoreError ):
4042
4143 def __init__ (self , message = None , json_body = None , error_type = None ):
@@ -46,6 +48,7 @@ def __init__(self, message=None, json_body=None, error_type=None):
4648 http_status = status_code , json_body = json_body )
4749
4850
51+ # Invalid API Key
4952class AuthorizationError (BlockscoreError ):
5053
5154 def __init__ (self , message = None , json_body = None , error_type = None ):
@@ -56,6 +59,7 @@ def __init__(self, message=None, json_body=None, error_type=None):
5659 http_status = status_code , json_body = json_body )
5760
5861
62+ # Tried to reference a nonexistent endpoint
5963class NotFoundError (BlockscoreError ):
6064
6165 def __init__ (self , message = None , json_body = None , error_type = None ):
@@ -66,6 +70,7 @@ def __init__(self, message=None, json_body=None, error_type=None):
6670 http_status = status_code , json_body = json_body )
6771
6872
73+ # Error on the Blockscore API
6974class InternalServerError (BlockscoreError ):
7075
7176 def __init__ (self , message = None , json_body = None , error_type = None ):
0 commit comments