summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/exc.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow metadata.reflect() to recover from unreflectable tablesMike Bayer2017-05-221-0/+8
| | | | | | | | | | | | | Added support for views that are unreflectable due to stale table definitions, when calling :meth:`.MetaData.reflect`; a warning is emitted for the table that cannot respond to ``DESCRIBE`` but the operation succeeds. The MySQL dialect now raises UnreflectableTableError which is in turn caught by MetaData.reflect(). Reflecting the view standalone raises this error directly. Change-Id: Id8005219d8e073c154cc84a873df911b4a6cf4d6 Fixes: #3871
* Integrate "pre-ping" into connection pool.Mike Bayer2017-03-201-0/+17
| | | | | | | | | | | | | | | Added native "pessimistic disconnection" handling to the :class:`.Pool` object. The new parameter :paramref:`.Pool.pre_ping`, available from the engine as :paramref:`.create_engine.pool_pre_ping`, applies an efficient form of the "pre-ping" recipe featured in the pooling documentation, which upon each connection check out, emits a simple statement, typically "SELECT 1", to test the connection for liveness. If the existing connection is no longer able to respond to commands, the connection is transparently recycled, and all other connections made prior to the current timestamp are invalidated. Change-Id: I89700d0075e60abd2250e54b9bd14daf03c71c00 Fixes: #3919
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Check for supports_execution at ClauseElement baseMike Bayer2016-08-311-0/+14
| | | | | | | | | | Raise a more descriptive exception / message when ClauseElement or non-SQLAlchemy objects that are not "executable" are erroneously passed to ``.execute()``; a new exception ObjectNotExecutableError is raised consistently in all cases. Change-Id: I2dd393121e2c7e5b6b9e40286a2f25670876e8e4 Fixes: #3786
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - Added support for the case of the misbehaving DBAPI that hasMike Bayer2015-05-151-3/+5
| | | | | | | | | | | pep-249 exception names linked to exception classes of an entirely different name, preventing SQLAlchemy's own exception wrapping from wrapping the error appropriately. The SQLAlchemy dialect in use needs to implement a new accessor :attr:`.DefaultDialect.dbapi_exception_translation_map` to support this feature; this is implemented now for the py-postgresql dialect. fixes #3421
* - tweaks regarding the use_alter updateMike Bayer2015-03-131-2/+1
|
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - remove the "edges" from the message here. It's illegibleMike Bayer2015-01-011-1/+1
|
* - Exception messages have been spiffed up a bit. The SQL statementMike Bayer2014-10-171-9/+12
| | | | | | | | | | | and parameters are not displayed if None, reducing confusion for error messages that weren't related to a statement. The full module and classname for the DBAPI-level exception is displayed, making it clear that this is a wrapped DBAPI exception. The statement and parameters themselves are bounded within a bracketed sections to better isolate them from the error message and from each other. fixes #3172
* - the test_except test was doing an unnecessary workaround of some kind,Mike Bayer2014-10-121-7/+3
| | | | take that out, restore the better exception logic in exc
* - roll back part of pr 140 to get exception wrapping working againMike Bayer2014-10-121-3/+7
|
* cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-021-3/+3
|
* - The exception wrapping system for DBAPI errors can now accommodateMike Bayer2014-07-291-3/+6
| | | | | | | | non-standard DBAPI exceptions, such as the psycopg2 TransactionRollbackError. These exceptions will now be raised using the closest available subclass in ``sqlalchemy.exc``, in the case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``. fixes #3075
* PEP8 style fixesBrian Jarrett2014-07-131-18/+21
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-0/+3
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - The :class:`.exc.StatementError` or DBAPI-related subclassMike Bayer2013-12-111-2/+11
| | | | | | | | | | now can accomodate additional information about the "reason" for the exception; the :class:`.Session` now adds some detail to it when the exception occurs within an autoflush. This approach is taken as opposed to combining :class:`.FlushError` with a Python 3 style "chained exception" approach so as to maintain compatibility both with Py2K code as well as code that already catches ``IntegrityError`` or similar.
* Fix references to exceptionsVraj Mohan2013-11-141-3/+3
|
* - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynorMike Bayer2013-09-221-4/+0
|
* Fixed bug where the expression system relied upon the ``str()``Mike Bayer2013-07-121-0/+12
| | | | | | | | | | | | form of a some expressions when referring to the ``.c`` collection on a ``select()`` construct, but the ``str()`` form isn't available since the element relies on dialect-specific compilation constructs, notably the ``__getitem__()`` operator as used with a Postgresql ``ARRAY`` element. The fix also adds a new exception class :class:`.UnsupportedCompilationError` which is raised in those cases where a compiler is asked to compile something it doesn't know how to. Also in 0.8.3. [ticket:2780]
* - the raw 2to3 runMike Bayer2013-04-271-1/+1
| | | | - went through examples/ and cleaned out excess list() calls
* fix markupMike Bayer2013-02-021-0/+1
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/Diana Clarke2012-11-191-17/+37
|
* - get all tests within -w engine + pyodbc:mssql on windows to passMike Bayer2012-09-011-0/+2
|
* - document the inspection systemMike Bayer2012-07-181-1/+1
|
* - express most of the orm.util functions in terms of the inspection systemMike Bayer2012-07-161-28/+28
| | | | | | | | | | | | | | - modify inspection system: 1. raise a new exception for any case where the inspection context can't be returned. this supersedes the "not mapped" errors. 2. don't configure mappers on a mapper inspection. this allows the inspectors to be used during mapper config time. instead, the mapper configures on "with_polymorphic_selectable" now, which is needed for all queries - add a bunch of new "is_XYZ" attributes to inspectors - finish making the name change of "compile" -> "configure", for some reason this was only done partially
* start to work on error messages, allow foreign_keys as only argumentMike Bayer2012-02-251-0/+7
| | | | if otherwise can't determine join condition due to no fks
* - add a warning regarding tuple.in_(), [ticket:2395]Mike Bayer2012-02-041-7/+16
| | | | - cleanup of exc.DBAPIError docstrings
* another serializable for [ticket:2371]Mike Bayer2012-01-121-2/+9
|
* further fixes for column/table errorsMike Bayer2012-01-111-0/+7
|
* some adjustments for py3kMike Bayer2012-01-111-1/+1
|
* - [bug] Added __reduce__ to StatementError,Mike Bayer2012-01-101-0/+8
| | | | | | | DBAPIError so that exceptions are pickleable, as when using multiprocessing. However, not all DBAPIs support this yet, such as psycopg2. [ticket:2371]
* happy new yearMike Bayer2012-01-041-1/+1
|
* marathon doc updating session including a rewrite of unicode paragraphsMike Bayer2011-12-041-1/+4
|
* more specificMike Bayer2011-09-231-3/+4
|
* document CircularDependencyError. [ticket:2285]Mike Bayer2011-09-231-2/+17
|
* - Improvement to multi-param statement logging,Mike Bayer2011-08-221-8/+4
| | | | | | | | long lists of bound parameter sets will be compressed with an informative indicator of the compression taking place. Exception messages use the same improved formatting. [ticket:2243]
* if python 2.4, have DontWrapException be old styleMike Bayer2011-06-261-0/+4
|
* - Added mixin class sqlalchemy.ext.DontWrapMixin.Mike Bayer2011-06-221-2/+27
| | | | | | | | | | User-defined exceptions of this type are never wrapped in StatementException when they occur in the context of a statement execution. - StatementException wrapping will display the original exception class in the message.
* ha - can't do this on 2.4Mike Bayer2011-05-071-2/+2
|
* - Changed the handling in determination of joinMike Bayer2011-05-071-0/+9
| | | | | | | | | | | conditions such that foreign key errors are only considered between the two given tables. That is, t1.join(t2) will report FK errors that involve 't1' or 't2', but anything involving 't3' will be skipped. This affects join(), as well as ORM relationship and inherit condition logic. Will keep the more conservative approach to [ticket:2153] in 0.6.
* corrected a bunch of spelling typosDiana Clarke2011-02-281-4/+4
|
* - Non-DBAPI errors which occur in the scope of an `execute()`Mike Bayer2011-02-091-24/+53
| | | | | | | | call are now wrapped in sqlalchemy.exc.StatementError, and the text of the SQL statement and repr() of params is included. This makes it easier to identify statement executions which fail before the DBAPI becomes involved. [ticket:2015]
* - whitespace removal bonanzaMike Bayer2011-01-021-2/+2
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-1/+2
| | | | | a consistent tag - AUTHORS file
* py2.4 didn't seem to like super() on an exceptionMike Bayer2010-09-291-1/+1
|
* - CircularDependencyError now has .cycles and .edgesMike Bayer2010-09-291-1/+5
| | | | | | members, which are the set of elements involved in one or more cycles, and the set of edges as 2-tuples. [ticket:1890]