@@ -83,7 +83,7 @@ def _handle_success(
8383 return model_class (decoded_body ) # type: ignore
8484
8585 def _exception_for_error (
86- self , status : int , content_type : str , raw_body : str , uri : str
86+ self , status : int , content_type : Optional [ str ] , raw_body : str , uri : str
8787 ) -> Union [
8888 AuthenticationError ,
8989 InsufficientFundsError ,
@@ -100,7 +100,7 @@ def _exception_for_error(
100100 return self ._exception_for_unexpected_status (status , raw_body , uri )
101101
102102 def _exception_for_4xx_status (
103- self , status : int , content_type : str , raw_body : str , uri : str
103+ self , status : int , content_type : Optional [ str ] , raw_body : str , uri : str
104104 ) -> Union [
105105 AuthenticationError ,
106106 InsufficientFundsError ,
@@ -113,7 +113,7 @@ def _exception_for_4xx_status(
113113 return HTTPError (
114114 f"Received a { status } error with no body" , status , uri , raw_body
115115 )
116- if content_type .find ("json" ) == - 1 :
116+ if content_type is None or content_type .find ("json" ) == - 1 :
117117 return HTTPError (
118118 f"Received a { status } with the following body: { raw_body } " ,
119119 status ,
0 commit comments