On this page
sqlite3.Error
Prev: sqlite3.enable_callback_tracebacks | Up: sqlite3 | Next: sqlite3.IntegrityError
Rel: sqlite3.adapt, sqlite3.Binary, sqlite3.Blob, sqlite3.complete_statement
Ref: docs.python.org โ sqlite3.Error
Tags: #public #python3 #stdlib #sqlite3
Import
import sqlite3
from sqlite3 import Error
Signature & Overview
sqlite3.Error(...)
sqlite3.Error class.
Methods & Attributes
Error.add_note(self, note, /)โ Add a note to the exceptionError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import sqlite3
assert issubclass(sqlite3.DatabaseError, sqlite3.Error)
assert issubclass(sqlite3.InterfaceError, sqlite3.Error)
Gotchas
- Top-level exception for all
sqlite3errors: Catchsqlite3.Errorwhen you want a single catch-all around database operations.
REPL Inspect
from sqlite3 import Error
help(Error)
Linked from
Related notes
- tuts/python3/stdlib_module/sqlite3 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/enable_callback_tracebacks Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/IntegrityError Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/adapt Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Binary Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Blob Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/complete_statement Linked here; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib