def exception(self, message=None, as_warning=False): backtrace = traceback.format_exc() if message is None: message = "unhandled exception: " + backtrace.splitlines()[-1] if as_warning: self.__logger.warning(message + "\n" + indent(backtrace)) else: self.__logger.error(message + "\n" + indent(backtrace))
def handle_input(self, value): try: result = json_decode(value) except ValueError: self.server.error("invalid response:\n" + indent(value)) result = self.request.copy() result["error"] = value for client in self.clients: client.add_result(result) self.server.request_finished(self, self.request, result)
def handle_input(self, _file, value): try: result = json_decode(value) except ValueError: self.server.error("invalid response:\n" + indent(value)) result = self.request.copy() result["error"] = value for client in self.clients: client.add_result(result) self.server.request_finished(self, self.request, result)
def exception(self, message=None): backtrace = traceback.format_exc() if message is None: message = "unhandled exception: " + backtrace.splitlines()[-1] self.__logger.error(message + "\n" + indent(backtrace))
def exception(self, message="uncaught exception:"): self.__logger.error(message + "\n" + indent(traceback.format_exc()))