Skip to content

Commit 8af122b

Browse files
pintaoz-awspintaoz
authored andcommitted
Fix key error in _send_metrics() (aws#5068)
Co-authored-by: pintaoz <pintaoz@amazon.com>
1 parent 10f4687 commit 8af122b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sagemaker/experiments/_metrics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ def _send_metrics(self, metrics):
197197
response = self._metrics_client.batch_put_metrics(**request)
198198
errors = response["Errors"] if "Errors" in response else None
199199
if errors:
200-
message = errors[0]["Message"]
201-
raise Exception(f'{len(errors)} errors with message "{message}"')
200+
error_code = errors[0]["Code"]
201+
raise Exception(f'{len(errors)} errors with error code "{error_code}"')
202202

203203
def _construct_batch_put_metrics_request(self, batch):
204204
"""Creates dictionary object used as request to metrics service."""

0 commit comments

Comments
 (0)