Skip to content

Commit 1923114

Browse files
add proper error messaging
1 parent 0b16c9a commit 1923114

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/sagemaker/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,9 @@ def _bucket_owner_check(self, bucket_name):
654654
message = e.response["Error"]["Message"]
655655
if error_code == "403" and message == "Forbidden":
656656
LOGGER.error(
657-
"Bucket %s exists, but not in the AWS account configured in AWS Session."
657+
"Since default_bucket param was not set, SageMaker Python SDK tried to use "
658+
"%s bucket. The bucket exists, but not in the AWS account configured in "
659+
"SageMaker Session."
658660
"Please reach out to AWS Security to verify on bucket ownership."
659661
"To unblock it's recommended to use custom default_bucket "
660662
"param in sagemaker.Session",

tests/unit/test_default_bucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_default_bucket_s3_needs_bucket_owner_access(sagemaker_session, datetime
8585
sagemaker_session.default_bucket()
8686

8787
error_message = (
88-
" exists, but not in the AWS account configured in AWS Session."
88+
" exists, but not in the AWS account configured in SageMaker Session."
8989
"Please reach out to AWS Security to verify on bucket ownership."
9090
"To unblock it's recommended to use custom default_bucket "
9191
"param in sagemaker.Session"

0 commit comments

Comments
 (0)