SQLAlchemy 0.4 Documentation

Multiple Pages | One Page
Version: 0.4.2 Last Updated: 01/01/08 20:56:05

module sqlalchemy.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.

class ArgumentError(SQLAlchemyError)

Raised for all those conditions where invalid arguments are sent to constructed objects. This error generally corresponds to construction time state errors.

back to section top

class AssertionError(SQLAlchemyError)

Corresponds to internal state being detected in an invalid state.

back to section top

class CircularDependencyError(SQLAlchemyError)

Raised by topological sorts when a circular dependency is detected

back to section top

class CompileError(SQLAlchemyError)

Raised when an error occurs during SQL compilation

back to section top

class ConcurrentModificationError(SQLAlchemyError)

Raised when a concurrent modification condition is detected.

back to section top

class DBAPIError(SQLAlchemyError)

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.

If the error-raising operation occured in the execution of a SQL statement, that statement and its parameters will be available on the exception object in the statement and params attributes.

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

def __init__(self, statement, params, orig, connection_invalidated=False)

Construct a new DBAPIError.

def instance(cls, statement, params, orig, connection_invalidated=False)
back to section top

class DataError(DatabaseError)

Wraps a DB-API DataError.

back to section top

class DatabaseError(DBAPIError)

Wraps a DB-API DatabaseError.

back to section top

class DisconnectionError(SQLAlchemyError)

Raised within Pool when a disconnect is detected on a raw DB-API connection.

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

back to section top

class FlushError(SQLAlchemyError)

Raised when an invalid condition is detected upon a flush().

back to section top

class IntegrityError(DatabaseError)

Wraps a DB-API IntegrityError.

back to section top

class InterfaceError(DBAPIError)

Wraps a DB-API InterfaceError.

back to section top

class InternalError(DatabaseError)

Wraps a DB-API InternalError.

back to section top

class InvalidRequestError(SQLAlchemyError)

SQLAlchemy was asked to do something it can't do, return nonexistent data, etc.

This error generally corresponds to runtime state errors.

back to section top

class NoSuchColumnError(KeyError,SQLAlchemyError)

Raised by RowProxy when a nonexistent column is requested from a row.

back to section top

class NoSuchTableError(InvalidRequestError)

SQLAlchemy was asked to load a table's definition from the database, but the table doesn't exist.

back to section top

class NotSupportedError(DatabaseError)

Wraps a DB-API NotSupportedError.

back to section top

class OperationalError(DatabaseError)

Wraps a DB-API OperationalError.

back to section top

class ProgrammingError(DatabaseError)

Wraps a DB-API ProgrammingError.

back to section top

class SQLAlchemyError(Exception)

Generic error class.

back to section top

class TimeoutError(SQLAlchemyError)

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

back to section top
Up: API Documentation | Previous: module sqlalchemy.engine.url | Next: module sqlalchemy.interfaces