We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95caeba commit 1602823Copy full SHA for 1602823
src/sagemaker/jumpstart/constants.py
@@ -179,6 +179,13 @@
179
180
JUMPSTART_LOGGER = logging.getLogger("sagemaker.jumpstart")
181
182
-DEFAULT_JUMPSTART_SAGEMAKER_SESSION = Session(
183
- boto3.Session(region_name=JUMPSTART_DEFAULT_REGION_NAME)
184
-)
+try:
+ DEFAULT_JUMPSTART_SAGEMAKER_SESSION = Session(
+ boto3.Session(region_name=JUMPSTART_DEFAULT_REGION_NAME)
185
+ )
186
+except Exception as e: # pylint: disable=W0703
187
+ DEFAULT_JUMPSTART_SAGEMAKER_SESSION = None
188
+ JUMPSTART_LOGGER.warning(
189
+ "Unable to create default JumpStart SageMaker Session due to the following error: %s.",
190
+ str(e),
191
0 commit comments