Skip to content

Custom exception handling

Compare
Choose a tag to compare
@glentner glentner released this 13 Dec 20:41
· 368 commits to master since this release

This release fixes a bug and adds a new feature.

First, the -v/--version flag behavior from argparse is fixed via a patch to its version action class and now the VersionOption class that already existed is caught in the main method and takes the proper action.

Second, the Application class's main method was made more generalizable. Now, you can define a class-level variable named exceptions as a dictionary of exception types with handler functions. These handler functions should take the exception instance as its only argument and return an exit status.