summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/exc.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove version directives for 0.6, 0.7, 0.8Mike Bayer2019-01-151-3/+0
| | | | | | | | | - fix a few "seealso"s - ComparableProprerty's "superseded in 0.7" becomes deprecated in 0.7 Backport to currently maintained doc versions 1.2, 1.1 Change-Id: Ib1fcb2df8673dbe5c4ffc47f3896a60d1dfcb4b2
* happy new yearMike Bayer2019-01-111-1/+1
| | | | Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
* Leave bytestring exception messages as bytestringsMike Bayer2019-01-101-10/+33
| | | | | | | | | | | | | | | | | Fixed a regression introduced in version 1.2 where a refactor of the :class:`.SQLAlchemyError` base exception class introduced an inappropriate coercion of a plain string message into Unicode under python 2k, which is not handled by the Python interpreter for characters outside of the platform's encoding (typically ascii). The :class:`.SQLAlchemyError` class now passes a bytestring through under Py2K for ``__str__()`` as is the behavior of exception objects in general under Py2K, does a safe coercion to unicode utf-8 with backslash fallback for ``__unicode__()``. For Py3K the message is typically unicode already, but if not is again safe-coerced with utf-8 with backslash fallback for the ``__str__()`` method. Fixes: #4429 Change-Id: I2289da3f2c45c7d0041fa43d838958f7614defc3
* Post black reformattingMike Bayer2019-01-061-1/+1
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-43/+78
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* happy new yearMike Bayer2018-01-121-1/+1
| | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
* Implement an error lookupMike Bayer2017-12-271-12/+79
| | | | | | | | Add codes to commonly raised error messages and classes that link back to fixed documentation sections giving background on these messages. Change-Id: I78d0660add7026bb662e20305a59283b20616954
* 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
|