File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ def as_json_safe_dict(self):
5858 )
5959
6060 return error_dict
61+
6162 @property
6263 def message (self ) -> Optional [str ]:
6364 """Get the error message"""
@@ -72,6 +73,7 @@ def error_code(self) -> Optional[str]:
7273 def raw_response_bytes (self ) -> Optional [bytes ]:
7374 """Get the raw response bytes"""
7475 return self ._raw_response_bytes
76+
7577 def __str__ (self ):
7678 if self ._error_code != ERROR_CODE_UNKNOWN :
7779 return f"('{ self ._message } ', '{ self ._error_code } ')"
@@ -130,15 +132,20 @@ def __init__(
130132 message = error_info .get ('message' )
131133 error_code = error_info .get ('errorCode' ) or ERROR_CODE_UNKNOWN
132134
133- super ().__init__ (message or f'HTTP status code: { status_code } ' , error_code ,
134- raw_response_bytes )
135+ super ().__init__ (
136+ message or f'HTTP status code: { status_code } ' ,
137+ error_code ,
138+ raw_response_bytes
139+ )
140+
135141 @property
136142 def status_code (self ) -> Optional [int ]:
137143 return self ._status_code
138144
139145 @property
140146 def reason (self ) -> Optional [str ]:
141147 return self ._reason
148+
142149 def as_dict (self ):
143150 error_dict = super ().as_dict ()
144151 error_dict ['status_code' ] = self ._status_code
You can’t perform that action at this time.
0 commit comments