Example #1
0
 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))
Example #2
0
 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))
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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))
Example #6
0
 def exception(self, message="uncaught exception:"):
     self.__logger.error(message + "\n" + indent(traceback.format_exc()))
Example #7
0
 def exception(self, message="uncaught exception:"):
     self.__logger.error(message + "\n" + indent(traceback.format_exc()))
Example #8
0
 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))