Esempio n. 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))
Esempio n. 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))
Esempio n. 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)
Esempio n. 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)
Esempio n. 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))
Esempio n. 6
0
 def exception(self, message="uncaught exception:"):
     self.__logger.error(message + "\n" + indent(traceback.format_exc()))
Esempio n. 7
0
 def exception(self, message="uncaught exception:"):
     self.__logger.error(message + "\n" + indent(traceback.format_exc()))
Esempio n. 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))