diff --git a/src/unstructured_client/_hooks/custom/logger_hook.py b/src/unstructured_client/_hooks/custom/logger_hook.py index 2a583e36..f142ebc3 100644 --- a/src/unstructured_client/_hooks/custom/logger_hook.py +++ b/src/unstructured_client/_hooks/custom/logger_hook.py @@ -81,5 +81,5 @@ def after_error( if response: logger.error("Server responded with %d - %s", response.status_code, response.text) if error is not None: - logger.error("Following error occurred - %s", error) + logger.error("Following error occurred - %s", error, exc_info=error) return response, error diff --git a/src/unstructured_client/_hooks/custom/request_utils.py b/src/unstructured_client/_hooks/custom/request_utils.py index a960ba29..ffb7a725 100644 --- a/src/unstructured_client/_hooks/custom/request_utils.py +++ b/src/unstructured_client/_hooks/custom/request_utils.py @@ -182,7 +182,7 @@ async def do_request(): ) return response except Exception as e: - print(e) + logger.error("Request failed with error", exc_info=e) raise e finally: if not isinstance(pdf_chunk_file, io.BytesIO) and not pdf_chunk_file.closed: