Skip to content

Commit 73bf733

Browse files
shayts7JKL98ISR
andauthored
Switched to ClientError exception in AWS S3 Credentials Setting (#251)
This PR is for this bug: https://linear.app/deepchecks/issue/MON-2399/aws-s3-connection-status-is-wrong Switching to ClientError seems to catch credential error. <img width="631" alt="Screenshot 2023-06-12 at 15 46 36" src="https://github.com/deepchecks/monitoring/assets/3765399/58ebd08f-10ea-4770-bed6-4d7bf0c21e0f"> --------- Co-authored-by: Jonathan Liberman <[email protected]>
1 parent 9faf485 commit 73bf733

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/deepchecks_monitoring/ee/api/v1/data_sources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import boto3
1414
import sqlalchemy as sa
1515
from botocore.config import Config
16-
from botocore.exceptions import BotoCoreError
16+
from botocore.exceptions import BotoCoreError, ClientError
1717
from fastapi import Depends, Response
1818
from pydantic.main import BaseModel
1919
from sqlalchemy.ext.asyncio import AsyncSession
@@ -74,7 +74,7 @@ async def new_data_source(body: DataSourceCreationSchema,
7474
config=Config(region_name=data_source.parameters['region'])
7575
)
7676
sts.get_caller_identity()
77-
except BotoCoreError as e:
77+
except (BotoCoreError, ClientError) as e:
7878
raise BadRequest('Invalid credentials to AWS') from e
7979
else:
8080
raise BadRequest('Invalid data source type')

0 commit comments

Comments
 (0)