From af80a4a00766d7535b41ede7e745a979e7a35118 Mon Sep 17 00:00:00 2001 From: Oleksandr Bazarnov Date: Thu, 28 Nov 2024 01:16:17 +0200 Subject: [PATCH] updated after the review --- airbyte_cdk/sources/streams/http/http_client.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/airbyte_cdk/sources/streams/http/http_client.py b/airbyte_cdk/sources/streams/http/http_client.py index 2a5be3280..4b56f7603 100644 --- a/airbyte_cdk/sources/streams/http/http_client.py +++ b/airbyte_cdk/sources/streams/http/http_client.py @@ -396,17 +396,15 @@ def _handle_error_resolution( f"'{request.method}' request to '{request.url}' failed with exception: '{exc}'" ) - exception = MessageRepresentationAirbyteTracedErrors( + # ensure the exception message is emitted before raised + self._logger.error(error_message) + + raise MessageRepresentationAirbyteTracedErrors( internal_message=error_message, message=error_resolution.error_message or error_message, failure_type=error_resolution.failure_type, ) - # ensure the exception message is emitted before raised - exception.emit_message() - - raise exception - elif error_resolution.response_action == ResponseAction.IGNORE: if response is not None: log_message = f"Ignoring response for '{request.method}' request to '{request.url}' with response code '{response.status_code}'"