MCPcopy Index your code
hub / github.com/RustPython/RustPython / ErrorHandler

Class ErrorHandler

Lib/xml/sax/handler.py:22–42  ·  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

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

Callers 2

parseFunction · 0.70
parseStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected