Custom exit with only some exceptions in Python
You can use a tuple of exception types with except, so your except clause could be simplified to:

except tuple(exit_codes) as exit_err:
    exit_code = int(exit_codes[type(exit_err)])
    sys.exit(exit_code)