Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (11 sloc) 479 Bytes
import logging
_HANDLED_ERRORS = ('fan error', 'bed missing')
def handle_error(comm, error_message, *args, **kwargs):
lower_error = error_message.lower()
if any(map(lambda x: x in lower_error, _HANDLED_ERRORS)):
logging.getLogger("octoprint.plugin.error_handler_test").info("Error \"{}\" is handled by this plugin".format(error_message))
return True
__plugin_name__ = "Comm Error Handler Test"
__plugin_hooks__ = {
"octoprint.comm.protocol.gcode.error": handle_error
}