A convenience function to display an error message when a handler raises an exception. If using --debug, it will print a full traceback. Args: e: the exception object plugin: the plugin object handler: name of the handler function
(e, plugin, handler)
| 66 | |
| 67 | |
| 68 | def print_handler_exception(e, plugin, handler): |
| 69 | """ |
| 70 | A convenience function to display an error message when a handler raises |
| 71 | an exception. |
| 72 | |
| 73 | If using --debug, it will print a full traceback. |
| 74 | |
| 75 | Args: |
| 76 | e: the exception object |
| 77 | plugin: the plugin object |
| 78 | handler: name of the handler function |
| 79 | """ |
| 80 | etype = e.__class__.__name__ |
| 81 | logger.error( |
| 82 | "The {!s} for the {!r} plugin raised an exception and failed! ({}: {!s})".format( |
| 83 | handler, plugin.name, etype, e)) |
| 84 | logger.debug(e, exc_info=True) |
| 85 | |
| 86 | |
| 87 | class PacketPlugin(object): |
no test coverage detected