Skip to content

Commit

Permalink
relax exception type (#140)
Browse files Browse the repository at this point in the history
no qa
  • Loading branch information
roywei authored Aug 16, 2022
1 parent 2104fe4 commit 62fb386
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sagemaker_training/smdataparallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@

# list of exceptions SMDDP wants training toolkit to catch and log
exception_classes = [x for x in dir(exceptions) if isclass(getattr(exceptions, x))]
except ImportError:
logger.info("No exception classes found in smdistributed.dataparallel")
# relaxed exception type in case of custom exceptions thrown during import
except Exception: # pylint: disable=broad-except
logger.info(
"smdistributed.dataparallel not found or "
"using an older version without custom exceptions."
"SM training toolkit will track user script error only"
)
exception_classes = [errors.ExecuteUserScriptError]


Expand Down

0 comments on commit 62fb386

Please sign in to comment.