Raise exception instead of calling sys.exit() on error
Is it possible to replace sys.exit()
with raise Exception("With error message")
?
I use python-ags4
with FastAPI (web framework) and I want to return an error message that may help the caller. I can catch the SystemExit
exception that the sys.exit()
raises, but I don't get any error message I can pass on to the caller.