[openstack-dev] [infra][neutron]SystemExit() vs sys.exit()?
Mark McClain
mmcclain at yahoo-inc.com
Fri May 2 20:02:12 UTC 2014
On May 2, 2014, at 10:28 AM, Doug Hellmann <doug.hellmann at dreamhost.com> wrote:
> As Robert said, libraries should not be calling sys.exit() or raising
> SystemExit directly, ever.
>
> Throwing SystemExit from a library bypasses other exception handling
> cleanup code higher in the stack that is unlikely to be looking for
> fatal exceptions like SystemExit (because well-behaved libraries don't
> throw those exceptions). Libraries should define meaningful
> exceptions, subclassed from Exception, which the main application can
> log before deciding whether to exit, retry, pick another driver, or
> whatever.
I’ll add this to the list of items to address as part of the clean up of the Neutron core code.
mark
More information about the OpenStack-dev
mailing list