File tree Expand file tree Collapse file tree 1 file changed +12
-23
lines changed
airbyte_cdk/sources/streams/http/requests_native_auth Expand file tree Collapse file tree 1 file changed +12
-23
lines changed Original file line number Diff line number Diff line change @@ -218,30 +218,19 @@ def _make_handled_request(self) -> Any:
218218 headers = self .build_refresh_request_headers (),
219219 )
220220
221- response_json = None
222- json_exception = None
223- try :
224- response_json = response .json ()
225- except Exception as e :
226- # if the json could not be parsed, save the exception to raise it later
227- json_exception = e
228-
229- try :
230- if response_json :
231- # extract the access token and add to secrets to avoid logging the raw value
232- access_key = self ._extract_access_token (response_json )
233- if access_key :
234- add_to_secrets (access_key )
235- except ResponseKeysMaxRecurtionReached as e :
236- # could not find the access token in the response, so do nothing
237- pass
238-
239- # log the response even if the request failed for troubleshooting purposes
221+ if not response .ok :
222+ # log the response even if the request failed for troubleshooting purposes
223+ self ._log_response (response )
224+ response .raise_for_status ()
225+
226+ response_json = response .json ()
227+
228+ # extract the access token and add to secrets to avoid logging the raw value
229+ access_key = self ._extract_access_token (response_json )
230+ if access_key :
231+ add_to_secrets (access_key )
232+
240233 self ._log_response (response )
241- response .raise_for_status ()
242-
243- if json_exception :
244- raise json_exception
245234
246235 return response_json
247236 except requests .exceptions .RequestException as e :
You can’t perform that action at this time.
0 commit comments