Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Source Amazon Seller Partner: Add logs for the failed check command #35106

Merged
merged 3 commits into from
Feb 12, 2024
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 @@ -15,7 +15,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: e55879a8-0ef8-4557-abcf-ab34c53ec460
dockerImageTag: 3.3.0
dockerImageTag: 3.3.1
dockerRepository: airbyte/source-amazon-seller-partner
documentationUrl: https://docs.airbyte.com/integrations/sources/amazon-seller-partner
githubIssueLabel: source-amazon-seller-partner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#


import traceback
from os import getenv
from typing import Any, List, Mapping, Optional, Tuple

Expand All @@ -11,6 +12,7 @@
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.utils import AirbyteTracedException
from requests import HTTPError
from source_amazon_seller_partner.auth import AWSAuthenticator
from source_amazon_seller_partner.constants import get_marketplaces
Expand Down Expand Up @@ -124,8 +126,11 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) ->
if isinstance(e, StopIteration):
return True, None

error_message = e.response.json().get("error_description") if isinstance(e, HTTPError) else e
return False, error_message
if isinstance(e, HTTPError):
return False, e.response.json().get("error_description")
else:
error_message = "Caught unexpected exception during the check"
raise AirbyteTracedException(internal_message=error_message, message=error_message, exception=e)

def streams(self, config: Mapping[str, Any]) -> List[Stream]:
"""
Expand Down
Loading
Loading