Closed bdorney closed 4 years ago
Is there an example where this functionality will be beneficial (catching rather than simply exiting)?
Is there an example where this functionality will be beneficial (catching rather than simply exiting)?
Off the top of my head no. But I think in general it might be better coding practice to generate an exception in an API function then exit in an manner that does not raise a SystemExit
exception. Especially as new developers come in and may not be familiar with the API...it may be difficult for them to trace down what's going on and raising an exception will ensure a stack trace.
Should this PR be merged or closed? The change seems trivial, but the PR require a rebase and a small change.
Description
Function
getDirByAnaType()
will no longer exit if input argumentanaType
is not in list of accepted types (ana_config
) but will instead raise aKeyError
which can be caught as an exception.Types of changes
Breaking because instead of exiting it will raise an error.
Motivation and Context
QOL; allow developers opportunity to catch bad
anaType
and handle this instead of automatically exiting.How Has This Been Tested?
Change was trivial.
Screenshots (if appropriate):
Checklist: