MCPcopy Index your code
hub / github.com/python/cpython / ErrorHandler

Class ErrorHandler

Lib/xml/sax/handler.py:20–40  ·  view source on GitHub ↗

Basic interface for SAX error handlers. If you create an object that implements this interface, then register the object with your XMLReader, the parser will call the methods in your object to report all warnings and errors. There are three levels of errors available: warnings, (pos

Source from the content-addressed store, hash-verified

18# ===== ERRORHANDLER =====
19
20class ErrorHandler:
21 """Basic interface for SAX error handlers.
22
23 If you create an object that implements this interface, then
24 register the object with your XMLReader, the parser will call the
25 methods in your object to report all warnings and errors. There
26 are three levels of errors available: warnings, (possibly)
27 recoverable errors, and unrecoverable errors. All methods take a
28 SAXParseException as the only parameter."""
29
30 def error(self, exception):
31 "Handle a recoverable error."
32 raise exception
33
34 def fatalError(self, exception):
35 "Handle a non-recoverable error."
36 raise exception
37
38 def warning(self, exception):
39 "Handle a warning."
40 print(exception)
41
42
43# ===== CONTENTHANDLER =====

Callers 2

parseFunction · 0.70
parseStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…