Skip to content

Commit 10a27b1

Browse files
committed
initialize response_json and json_exception to None at start
1 parent bf1eaf2 commit 10a27b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ def _make_handled_request(self) -> Any:
218218
headers=self.build_refresh_request_headers(),
219219
)
220220

221+
response_json = None
222+
json_exception = None
221223
try:
222224
response_json = response.json()
223225
except Exception as e:
@@ -231,7 +233,7 @@ def _make_handled_request(self) -> Any:
231233
if access_key:
232234
add_to_secrets(access_key)
233235
except ResponseKeysMaxRecurtionReached as e:
234-
## could not find the access token in the response, so do nothing
236+
# could not find the access token in the response, so do nothing
235237
pass
236238

237239
# log the response even if the request failed for troubleshooting purposes
@@ -240,7 +242,7 @@ def _make_handled_request(self) -> Any:
240242

241243
if json_exception:
242244
raise json_exception
243-
245+
244246
return response_json
245247
except requests.exceptions.RequestException as e:
246248
if e.response is not None:

0 commit comments

Comments
 (0)