Core Exceptions — SQLAlchemy 0.7.1 Documentation

# SQLAlchemy 0.7.1 Documentation

Search:
Version: 0.7.1 Last Updated: 06/05/2011 13:13:59

# Core Exceptions

Exceptions used with SQLAlchemy.

The base exception class is `SQLAlchemyError`. Exceptions which are raised as a result of DBAPI exceptions are all subclasses of `DBAPIError`.

exception `sqlalchemy.exc.` `ArgumentError`

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  Raised when an invalid or conflicting function argument is supplied.

  This error generally corresponds to construction time state errors.

exception `sqlalchemy.exc.` `CircularDependencyError`(message, cycles, edges)

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  Raised by topological sorts when a circular dependency is detected

exception `sqlalchemy.exc.` `CompileError`

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  Raised when an error occurs during SQL compilation

exception `sqlalchemy.exc.` `DBAPIError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.StatementError`

  Raised when the execution of a database operation fails.

  `DBAPIError` wraps exceptions raised by the DB-API underlying the database operation. Driver-specific implementations of the standard DB-API exception types are wrapped by matching sub-types of SQLAlchemy’s `DBAPIError` when possible. DB-API’s `Error` type maps to `DBAPIError` in SQLAlchemy, otherwise the names are identical. Note that there is no guarantee that different DB-API implementations will raise the same exception type for any given error condition.

  `DBAPIError` features `statement` and `params` attributes which supply context regarding the specifics of the statement which had an issue, for the typical case when the error was raised within the context of emitting a SQL statement.

  The wrapped exception object is available in the `orig` attribute. Its type and properties are DB-API implementation specific.

exception `sqlalchemy.exc.` `DataError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DatabaseError`

  Wraps a DB-API DataError.

exception `sqlalchemy.exc.` `DatabaseError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DBAPIError`

  Wraps a DB-API DatabaseError.

exception `sqlalchemy.exc.` `DisconnectionError`

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  A disconnect is detected on a raw DB-API connection.

  This error is raised and consumed internally by a connection pool. It can be raised by a `PoolListener` so that the host pool forces a disconnect.

exception `sqlalchemy.exc.` `IdentifierError`

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  Raised when a schema name is beyond the max character limit

exception `sqlalchemy.exc.` `IntegrityError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DatabaseError`

  Wraps a DB-API IntegrityError.

exception `sqlalchemy.exc.` `InterfaceError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DBAPIError`

  Wraps a DB-API InterfaceError.

exception `sqlalchemy.exc.` `InternalError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DatabaseError`

  Wraps a DB-API InternalError.

exception `sqlalchemy.exc.` `InvalidRequestError`

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  SQLAlchemy was asked to do something it can’t do.

  This error generally corresponds to runtime state errors.

exception `sqlalchemy.exc.` `NoReferenceError`

  Bases: `sqlalchemy.exc.InvalidRequestError`

  Raised by `ForeignKey` to indicate a reference cannot be resolved.

exception `sqlalchemy.exc.` `NoReferencedColumnError`(message, tname, cname)

  Bases: `sqlalchemy.exc.NoReferenceError`

  Raised by `ForeignKey` when the referred `Column` cannot be located.

exception `sqlalchemy.exc.` `NoReferencedTableError`(message, tname)

  Bases: `sqlalchemy.exc.NoReferenceError`

  Raised by `ForeignKey` when the referred `Table` cannot be located.

exception `sqlalchemy.exc.` `NoSuchColumnError`

  Bases: `exceptions.KeyError`, `sqlalchemy.exc.InvalidRequestError`

  A nonexistent column is requested from a `RowProxy`.

exception `sqlalchemy.exc.` `NoSuchTableError`

  Bases: `sqlalchemy.exc.InvalidRequestError`

  Table does not exist or is not visible to a connection.

exception `sqlalchemy.exc.` `NotSupportedError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DatabaseError`

  Wraps a DB-API NotSupportedError.

exception `sqlalchemy.exc.` `OperationalError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DatabaseError`

  Wraps a DB-API OperationalError.

exception `sqlalchemy.exc.` `ProgrammingError`(statement, params, orig, connection_invalidated=False)

  Bases: `sqlalchemy.exc.DatabaseError`

  Wraps a DB-API ProgrammingError.

exception `sqlalchemy.exc.` `ResourceClosedError`

  Bases: `sqlalchemy.exc.InvalidRequestError`

  An operation was requested from a connection, cursor, or other object that’s in a closed state.

exception `sqlalchemy.exc.` `SADeprecationWarning`

  Bases: `exceptions.DeprecationWarning`

  Issued once per usage of a deprecated API.

exception `sqlalchemy.exc.` `SAPendingDeprecationWarning`

  Bases: `exceptions.PendingDeprecationWarning`

  Issued once per usage of a deprecated API.

exception `sqlalchemy.exc.` `SAWarning`

  Bases: `exceptions.RuntimeWarning`

  Issued at runtime.

exception `sqlalchemy.exc.` `SQLAlchemyError`

  Bases: `exceptions.Exception`

  Generic error class.

exception `sqlalchemy.exc.` `StatementError`(message, statement, params, orig)

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  An error occurred during execution of a SQL statement.

  `StatementError` wraps the exception raised during execution, and features `statement` and `params` attributes which supply context regarding the specifics of the statement which had an issue.

  The wrapped exception object is available in the `orig` attribute.

exception `sqlalchemy.exc.` `TimeoutError`

  Bases: `sqlalchemy.exc.SQLAlchemyError`

  Raised when a connection pool times out on getting a connection.

exception `sqlalchemy.exc.` `UnboundExecutionError`

  Bases: `sqlalchemy.exc.InvalidRequestError`

  SQL was attempted without a database connection to execute it on.