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
| 18 | # ===== ERRORHANDLER ===== |
| 19 | |
| 20 | class 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 ===== |
no outgoing calls
no test coverage detected
searching dependent graphs…