This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44
55[project ]
66name = " facturapi-python"
7- version = " 0.1.2 "
7+ version = " 0.1.3 "
88authors = [{ name = " TI Sin Problemas" , email = " pypi@tisinproblemas.com" }]
99description = " Unofficial Facturapi.io Python client"
1010readme = " README.md"
Original file line number Diff line number Diff line change @@ -106,16 +106,18 @@ def _execute_request(
106106 raise FacturapiException (message ) from error
107107
108108 self .last_status = response .status_code
109+ error_status_codes = [
110+ self .STATUS_BAD_REQUEST ,
111+ self .STATUS_INTERNAL_SERVER_ERROR ,
112+ ]
109113
110- if response .status_code == self .STATUS_BAD_REQUEST :
111- raise FacturapiException (response ["message" ])
114+ if response .status_code in error_status_codes :
115+ json_response = response .json ()
116+ raise FacturapiException (json_response ["message" ])
112117
113118 if response .status_code == self .STATUS_NOT_AUTHENTICATED :
114119 raise FacturapiException ("Wrong API KEY" )
115120
116- if response .status_code == self .STATUS_INTERNAL_SERVER_ERROR :
117- raise FacturapiException (response ["message" ])
118-
119121 return response
120122
121123 def _get_download_file_url (self , file_format : str , object_id : str ):
You can’t perform that action at this time.
0 commit comments