MCPcopy
hub / github.com/USArmyResearchLab/Dshell / print_handler_exception

Function print_handler_exception

dshell/core.py:68–84  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

66
67
68def 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
87class PacketPlugin(object):

Callers 4

consume_packetMethod · 0.85
_connection_handlerMethod · 0.85
_handle_connectionMethod · 0.85
_blob_handlerMethod · 0.85

Calls 2

errorMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected