SAP DB:ODBC Przewodnik Instalacji Strona 183

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 225
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 182
10. mxODBC Exceptions and Error Handling
10.4 Error Handlers
If you want to provide your own error handler, e.g. to mask database warnings or
debug connection setups, you can do so by assigning to the
.errorhandler
attribute of connections and cursors or passing a callback function to the
connection constructors at connection creation time using the
errorhandler
keyword argument.
Error handlers are inherited from connections to cursors, so it normally suffices to
set an error handler on the connection object to have it take affect for all
subsequently created cursors.
Cursors created prior to setting the error handler on the connection will not see
or use the new error handler.
Error handler signature
An error handler has to be a callable object taking the arguments (connection,
cursor, errorclass, errorvalue)
where connection is a reference to the
connection (or
None in case the connection has not yet been setup), cursor a
reference to the cursor (or
None in case the error does not apply to a cursor or the
cursor has not yet been setup),
errorclass is an error class which to instantiate
using
errorvalue as construction argument.
Return values are currently not defined.
This a typical error handler function:
from mx.ODBC.Windows import Warning
# Error handler function
def myerrorhandler(connection, cursor, errorclass, errorvalue):
if issubclass(errorclass, Warning):
print ('Ignoring warning %s' % errorvalue)
else:
raise errorclass(*errorvalue)
Default error handler
The default mxODBC error handler will append the tuple (errorclass,
errorvalue)
to the .messages list of the cursor or connection (if cursor is None)
and then raise the exception by instantiating
errorclass with errorvalue.
Error processing
Note that only database and ODBC driver/manager related errors are processed
through the error handlers. Other errors such as mxODBC internal or
AttributeErrors are not processed by these handlers.
161
Przeglądanie stron 182
1 2 ... 178 179 180 181 182 183 184 185 186 187 188 ... 224 225

Komentarze do niniejszej Instrukcji

Brak uwag

Panasonic TX55DXF687 Handbücher

Bedienungsanleitungen und Benutzerhandbücher für DVD Spieler Panasonic TX55DXF687.
Wir stellen PDF-Handbücher Panasonic TX55DXF687 zum kostenlosen herunterladen nach Dokumenttypen zur Verfügung






Weitere Produkte und Handbücher für DVD Spieler Panasonic

Modelle Dokumententyp
DMREH55 Bedienungsanleitung   Panasonic DMREH55 User manual, 76 Seiten
DVD-S48 Datenblatt   Panasonic DVD-S48, 2 Seiten
DMR-EX769 Betriebsanleitung   Panasonic DMREX769 User manual, 72 Seiten
DMREX773 Betriebsanleitung   Panasonic DMREX773 User manual, 80 Seiten
NVVP32Series Betriebsanleitung   Panasonic NVVP32Series User manual, 48 Seiten
DMRES15 Betriebsanleitung   Panasonic DMRES15 User manual, 52 Seiten
NVVHD1EC Betriebsanleitung   Panasonic NVVHD1EC User manual, 24 Seiten
DMR-E50EG9-S Betriebsanleitung   Panasonic DMR-E50EG9-S, 64 Seiten
DMRES15EBL Betriebsanleitung   Panasonic DMRES15EBL User manual, 52 Seiten
SCDV290EB Betriebsanleitung   Panasonic SCDV290EB User manual, 52 Seiten
DVDLS5 Betriebsanleitung   Panasonic DVDLS5 User manual, 22 Seiten
DMREH65 Betriebsanleitung   Panasonic DMREH65 User manual, 76 Seiten
NVVP60SERIES Betriebsanleitung   Panasonic NVVP60SERIES User manual, 44 Seiten
DVDLS87 Betriebsanleitung   Panasonic DVDLS87 User manual, 28 Seiten
DVDS295 Betriebsanleitung   Panasonic DVDS295 User manual, 24 Seiten
DVD- 2OO3 Betriebsanleitung   Panasonic DVDF84 User manual, 20 Seiten
DMREX93CEG Bedienungsanleitung   Panasonic DMREX93CEG Benutzerhandbuch, 92 Seiten
SCPT150 Bedienungsanleitung   Panasonic SCPT150 User manual, 40 Seiten
CQVW100N Bedienungsanleitung   Panasonic CQVW100N User manual, 52 Seiten
DMRBCT735 Bedienungsanleitung   Panasonic DMRBCT730EG Benutzerhandbuch, 128 Seiten