Join GitHub today
API code uses sys.exit to signal errors #35
Migrated issue, originally created by Robert Buchholz (@rbuchholz)
The documentation describes the following as API to stamp a database:
If stamp encounters an error reading the config file, it will use util.err which stops program execution immediately:
While it is possible to catch SystemExit, I would favor a more specific exception that includes the error message for the API part of the command.
Michael Bayer (@zzzeek) wrote:
oh that's just a bug, util.err() should only be called in main() when the runner is definitely via commandline. It's a CommandError in [[https://bitbucket.org/zzzeek/alembic/changeset/6aeeebeb8a1401b010347bbae8373d0422ee8ba3|6aeeebeb8a1401b010347bbae8373d0422ee8ba3]].