Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,16 @@ def _make_handled_request(self) -> Any:
failure_type=FailureType.transient_error,
)
if self._wrap_refresh_token_exception(e):
message = "Refresh token is invalid or expired. Please re-authenticate from Sources/<your source>/Settings."
raise AirbyteTracedException(
internal_message=message, message=message, failure_type=FailureType.config_error
response_info = (
f"HTTP {e.response.status_code}: {e.response.text[:1000]}"
if e.response is not None
else str(e)
)
raise AirbyteTracedException(
internal_message=f"Refresh token rejected by the OAuth token endpoint. {response_info}",
message="Refresh token was rejected by the OAuth provider (invalid, expired, or already used). Re-authenticate this source's credentials in its connection settings.",
failure_type=FailureType.config_error,
) from e
raise
except Exception as e:
raise AirbyteTracedException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,12 @@ def test_refresh_access_token_wrapped(
oauth.refresh_access_token()

if wrapped:
error_message = "Refresh token is invalid or expired. Please re-authenticate from Sources/<your source>/Settings."
assert exc_info.value.internal_message == error_message
error_message = "Refresh token was rejected by the OAuth provider (invalid, expired, or already used). Re-authenticate this source's credentials in its connection settings."
assert exc_info.value.internal_message.startswith(
"Refresh token rejected by the OAuth token endpoint."
)
assert f"HTTP {response_code}" in exc_info.value.internal_message
assert response_value in exc_info.value.internal_message
assert exc_info.value.message == error_message
assert exc_info.value.failure_type == FailureType.config_error

Expand Down
Loading