libredte 4.0.0__tar.gz → 4.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libredte-4.0.0 → libredte-4.0.2}/PKG-INFO +1 -1
- {libredte-4.0.0 → libredte-4.0.2}/libredte/api_client/__init__.py +23 -2
- {libredte-4.0.0 → libredte-4.0.2}/libredte.egg-info/PKG-INFO +1 -1
- {libredte-4.0.0 → libredte-4.0.2}/setup.py +1 -1
- {libredte-4.0.0 → libredte-4.0.2}/COPYING +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/README.rst +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/libredte/__init__.py +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/libredte.egg-info/SOURCES.txt +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/libredte.egg-info/dependency_links.txt +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/libredte.egg-info/requires.txt +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/libredte.egg-info/top_level.txt +0 -0
- {libredte-4.0.0 → libredte-4.0.2}/setup.cfg +0 -0
|
@@ -295,7 +295,7 @@ class ApiClient:
|
|
|
295
295
|
)
|
|
296
296
|
except json.decoder.JSONDecodeError:
|
|
297
297
|
error_message = f'Error al decodificar los datos en JSON: {error.response.text}'
|
|
298
|
-
raise ApiException(
|
|
298
|
+
raise ApiException(error_message, response.status_code)
|
|
299
299
|
return response
|
|
300
300
|
|
|
301
301
|
def create_link(self, resource, rut = None):
|
|
@@ -332,7 +332,28 @@ class ApiException(Exception):
|
|
|
332
332
|
|
|
333
333
|
def __init__(self, message, code=None, params=None):
|
|
334
334
|
self.message = message
|
|
335
|
-
|
|
335
|
+
self.code = code
|
|
336
|
+
self.params = params
|
|
337
|
+
super().__init__(message)
|
|
338
|
+
|
|
339
|
+
def __str__(self):
|
|
340
|
+
"""
|
|
341
|
+
Devuelve una representación en cadena del error, proporcionando un contexto claro
|
|
342
|
+
del problema ocurrido. Esta representación incluye el prefijo "[LibreDTE]",
|
|
343
|
+
seguido del código de error si está presente, y el mensaje de error.
|
|
344
|
+
|
|
345
|
+
Si se especifica un código de error, el formato será:
|
|
346
|
+
"[LibreDTE] Error {code}: {message}"
|
|
347
|
+
|
|
348
|
+
Si no se especifica un código de error, el formato será:
|
|
349
|
+
"[LibreDTE] {message}"
|
|
350
|
+
|
|
351
|
+
:return: Una cadena que representa el error de una manera clara y concisa.
|
|
352
|
+
"""
|
|
353
|
+
if self.code is not None:
|
|
354
|
+
return f"[LibreDTE] Error {self.code}: {self.message}"
|
|
355
|
+
else:
|
|
356
|
+
return f"[LibreDTE] {self.message}"
|
|
336
357
|
|
|
337
358
|
class ApiBase(ABC):
|
|
338
359
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|