The congress.exception Module

Congress base exception handling.

exception congress.exception.BadConfig(message=None, **kwargs)

Bases: congress.exception.BadRequest

exception congress.exception.BadRequest(message=None, **kwargs)

Bases: congress.exception.CongressException

code = 400
msg_fmt = ‘Bad request’
exception congress.exception.Conflict(message=None, **kwargs)

Bases: congress.exception.CongressException

code = 409
msg_fmt = ‘Conflict’
exception congress.exception.CongressException(message=None, **kwargs)

Bases: exceptions.Exception

Base Congress Exception

To correctly use this class, inherit from it and define a ‘msg_fmt’ property. That msg_fmt will get printf’d with the keyword arguments provided to the constructor.

code = 500
format_message()
headers = {}
msg_fmt = ‘An unknown exception occurred.’
safe = False
exception congress.exception.DanglingReference(message=None, **kwargs)

Bases: congress.exception.Conflict

exception congress.exception.DataServiceError

Bases: exceptions.Exception

exception congress.exception.DataSourceConfigException

Bases: exceptions.Exception

exception congress.exception.DatabaseError(message=None, **kwargs)

Bases: congress.exception.CongressException

msg_fmt = ‘Database backend experienced an unknown error.’
exception congress.exception.DatasourceCreationError(message=None, **kwargs)

Bases: congress.exception.BadConfig

msg_fmt = ‘Datasource could not be created on the DSE: %(value)s’
exception congress.exception.DatasourceDriverException(message=None, **kwargs)

Bases: congress.exception.CongressException

exception congress.exception.DatasourceNameInUse(message=None, **kwargs)

Bases: congress.exception.Conflict

msg_fmt = ‘Datasource already in use with name %(value)s’
exception congress.exception.DatasourceNotFound(message=None, **kwargs)

Bases: congress.exception.NotFound

msg_fmt = ‘Datasource not found %(id)s’
exception congress.exception.DriverNotFound(message=None, **kwargs)

Bases: congress.exception.NotFound

msg_fmt = ‘Driver not found %(id)s’
exception congress.exception.DuplicateTableName

Bases: exceptions.Exception

exception congress.exception.Forbidden(message=None, **kwargs)

Bases: congress.exception.CongressException

code = 403
msg_fmt = ‘Not authorized.’
exception congress.exception.IncompleteSchemaException(message=None, **kwargs)

Bases: congress.exception.CongressException

exception congress.exception.InvalidDatasourceName(message=None, **kwargs)

Bases: congress.exception.BadConfig

msg_fmt = ‘Datasource name %(value) is invalid. Cannot be empty or start with underscore. Must be valid in policy language’
exception congress.exception.InvalidDriver(message=None, **kwargs)

Bases: congress.exception.BadConfig

msg_fmt = ‘Invalid driver: %(driver)s’
exception congress.exception.InvalidDriverOption(message=None, **kwargs)

Bases: congress.exception.BadConfig

msg_fmt = ‘Invalid driver options: %(invalid_options)s’
exception congress.exception.InvalidParamException

Bases: exceptions.Exception

exception congress.exception.InvalidTranslationType

Bases: exceptions.Exception

exception congress.exception.LazyTable(message=None, **kwargs)

Bases: congress.exception.BadRequest

msg_fmt = ‘table %(lazy_table)s is a lazy table and is not subscribed.’
exception congress.exception.MissingRequiredConfigOptions(message=None, **kwargs)

Bases: congress.exception.BadConfig

msg_fmt = ‘Missing required config options: %(missing_options)s’
exception congress.exception.NotFound(message=None, **kwargs)

Bases: congress.exception.CongressException

code = 404
msg_fmt = ‘Resource not found.’
exception congress.exception.PolicyException(msg=None, obj=None, line=None, col=None, name=None, data=None, **kwargs)

Bases: congress.exception.CongressException

exception congress.exception.PolicyNotAuthorized(message=None, **kwargs)

Bases: congress.exception.Forbidden

msg_fmt = “Policy doesn’t allow %(action)s to be performed.”
exception congress.exception.PolicyRuntimeException(message=None, **kwargs)

Bases: congress.exception.CongressException