Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-89018: Improve documentation ofsqlite3 exceptions#27645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
1cee1d0
Document all sqlite3 exceptions
Aug 6, 2021
0e6af97
Add markup for except keyword
Aug 6, 2021
b3ae237
Address review: adjust DataError wording
Aug 7, 2021
defa180
Merge branch 'main' into sqlite-doc-exceptions
Apr 7, 2022
86baece
WIP
Apr 12, 2022
1c20bf5
Merge branch 'main' into sqlite-doc-exceptions
erlend-aaslandMay 25, 2022
7951b1c
Sync with main
erlend-aaslandMay 25, 2022
18d701e
Update Doc/library/sqlite3.rst
May 31, 2022
7a12a7b
Update Doc/library/sqlite3.rst
May 31, 2022
9fec685
Update Doc/library/sqlite3.rst
May 31, 2022
e0cc0d4
Update Doc/library/sqlite3.rst
May 31, 2022
1ceb02f
Update Doc/library/sqlite3.rst
May 31, 2022
91494dd
Address review
erlend-aaslandMay 31, 2022
aa140d4
Reword ProgrammingError
erlend-aaslandJun 1, 2022
59dcdbd
Reword Waning
erlend-aaslandJun 1, 2022
9c112a8
Revert incorrect change
erlend-aaslandJun 1, 2022
8b7293e
Revert "Revert incorrect change"
erlend-aaslandJun 1, 2022
c25c95e
Update Doc/library/sqlite3.rst
Jun 1, 2022
7c1bd6c
Adjust a couple of more inconsistencies
erlend-aaslandJun 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Sync with main
  • Loading branch information
@erlend-aasland
erlend-aasland committedMay 25, 2022
commit7951b1c0a3d2636cf0fdbbc8ae1b4d541bc8e173
60 changes: 35 additions & 25 deletionsDoc/library/sqlite3.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1103,12 +1103,13 @@ The exception hierarchy is defined by DB-API 2.0.
.. exception:: Warning

This exception is not raised by :mod:`sqlite3`.
``Warning`` is a subclass of :exc:`Exception`.

.. exception:: Error

The base class of the othererrorexceptions in this module. Use this to
catch all errors with one single :keyword:`except` statement. :exc:`Error`
is a subclass of :exc:`Exception`.
The base class of the other exceptions in this module.
Use this tocatch all errors with one single :keyword:`except` statement.
``Error``is a subclass of :exc:`Exception`.

.. attribute:: sqlite_errorcode

Expand All@@ -1126,50 +1127,59 @@ The exception hierarchy is defined by DB-API 2.0.

.. exception:: InterfaceError

Exception raised for errors that are related to the database interface
rather than the database itself. It is a subclass of :exc:`Error`.
Exception raised for misuse of the low-level SQLite C API.
In other words, if this exception is raised, it is probably a bug in the
``sqlite3`` module.
``InterfaceError`` is a subclass of :exc:`Error`.

.. exception:: DatabaseError

Exception raised for errors that are related to the database. It is a
subclass of :exc:`Error`.
Exception raised for errors that are related to the database.
This serves the base exception for several types of database errors.
It is only raised implicitly through the specialised variants.
``DatabaseError`` is a subclass of :exc:`Error`.

.. exception:: DataError

Exception raised for errorsthat are due toproblems with the processed data
like numeric value out of range and too long strings, etc. It is a subclass
of :exc:`DatabaseError`.
Exception raised for errorscaused byproblems with the processed data,
like numeric value out of range, and too long strings.
``DataError`` is a subclassof :exc:`DatabaseError`.

.. exception:: OperationalError

Exception raised for errors that are related to the database's operation
and not necessarily under the control of the programmer, e.g. an unexpected
disconnect occurs, the data source name is not found, a transaction could
not be processed, etc. It is a subclass of :exc:`DatabaseError`.
Exception raised for errors that are related to the database's operation,
and not necessarily under the control of the programmer.
For example, the database path is not found,
or a transaction could not be processed.
``OperationalError`` is a subclass of :exc:`DatabaseError`.

.. exception:: IntegrityError

Exception raised when the relational integrity of the database is affected,
e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`.
for example, a foreign key check fails.
``IntegrityError`` is a subclass of :exc:`DatabaseError`.

.. exception:: InternalError

Exception raised when the database encounters an internal error, e.g. the
cursor is not valid anymore, the transaction is out of sync, etc. It is a
subclass of :exc:`DatabaseError`.
Exception raised when SQLite encounters an internal error.
If this is raised, it may indicate that there is a problem with the runtime
SQLite library.
``InternalError`` is a subclass of :exc:`DatabaseError`.

.. exception:: ProgrammingError

Exception raised for programming errors, e.g. table not found or already
exists, syntax error in the SQL statement, wrong number of parameters
specified, etc. It is a subclass of :exc:`DatabaseError`.
Exception raised for ``sqlite3`` API programming errors.
for example syntax errors in SQL statements, and wrong number of bindings
supplied to a query.
``ProgrammingError`` is a subclass of :exc:`DatabaseError`.

.. exception:: NotSupportedError

Exception raised in case a method or database API was used which is not
supported by the database, e.g. calling the :meth:`~Connection.rollback`
method on a connection that does not support transaction or has
transactions turned off. It is a subclass of :exc:`DatabaseError`.
Exception raised in case a method or database API is not supported by the
underlying SQLite library. For example, setting *deterministic* to
:const:`True` in :meth:`create_function`, if the underlying SQLite library
does not support deterministic functions.
``NotSupportedError`` is a subclass of :exc:`DatabaseError`.


.. _sqlite3-blob-objects:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp