def _send_report_to_server(self, share_identifiable=False, name='', email='', file_hash='', uptime='', text_box=''): errorReporter = ErrorReporter( self._application, uptime, self._exit_code, share_identifiable, str(name), str(email), str(text_box), str(file_hash)) status = errorReporter.sendErrorReport() if status != 201: self._view.display_message_box('Error contacting server', self.SENDING_ERROR_MESSAGE, 'http request returned with status {}'.format(status)) self.error_log.error("Failed to send error report http request returned status {}".format(status)) return status
def _send_report_to_server(self, share_identifiable=False, name='', email='', file_hash='', uptime='', text_box=''): errorReporter = ErrorReporter( "mantidplot", uptime, self._exit_code, share_identifiable, str(name), str(email), str(text_box), str(file_hash)) status = errorReporter.sendErrorReport() if status != 201: self._view.display_message_box('Error contacting server', 'There was an error when sending the report.' 'Please contact [email protected] directly', 'http request returned with status {}'.format(status)) self.error_log.error("Failed to send error report http request returned status {}".format(status)) return status
def show_more_details(self): error_reporter = ErrorReporter( self._application, UsageService.getUpTime(), self._exit_code, True, str(self._view.input_name_line_edit.text()), str(self._view.input_email_line_edit.text()), str(self._view.input_free_text.toPlainText()), "".join(self._traceback)) error_message_json = json.loads(error_reporter.generateErrorMessage()) stacktrace_text = error_message_json["stacktrace"] del error_message_json[ "stacktrace"] # remove this entry so it doesn't appear twice. user_information = ''.join( '{}: {}\n'.format(key, error_message_json[key]) for key in error_message_json) self._view.display_more_details(user_information, stacktrace_text)
def _send_report_to_server(self, share_identifiable=False, name='', email='', uptime='', text_box=''): errorReporter = ErrorReporter(self._application, uptime, self._exit_code, share_identifiable, str(name), str(email), str(text_box), "".join(self._traceback)) status = errorReporter.sendErrorReport() if status != 201: self._view.display_message_box( 'Error contacting server', self.SENDING_ERROR_MESSAGE, 'http request returned with status {}'.format(status)) self.error_log.error( "Failed to send error report http request returned status {}". format(status)) return status
def error_handler(self, continue_working, share, name, email, textBox): status = -1 if share == 0: errorReporter = ErrorReporter("mantidplot", UsageService.getUpTime(), self._exit_code, True, str(name), str(email), str(textBox)) status = errorReporter.sendErrorReport() elif share == 1: errorReporter = ErrorReporter("mantidplot", UsageService.getUpTime(), self._exit_code, False, str(name), str(email), str(textBox)) status = errorReporter.sendErrorReport() if status != 201: self._view.display_message_box( 'Error contacting server', 'There was an error when sending the report.' 'Please contact [email protected] directly', 'http request returned with status {}'.format(status)) self.error_log.error( "Failed to send error report http request returned status {}". format(status)) if not continue_working: self.error_log.error("Terminated by user.") self._view.quit() else: self.error_log.error("Continue working.")
def _send_report_to_server(self, share_identifiable=False, name='', email='', file_hash='', uptime='', text_box=''): errorReporter = ErrorReporter("mantidplot", uptime, self._exit_code, share_identifiable, str(name), str(email), str(text_box), str(file_hash)) status = errorReporter.sendErrorReport() if status != 201: self._view.display_message_box( 'Error contacting server', 'There was an error when sending the report.' 'Please contact [email protected] directly', 'http request returned with status {}'.format(status)) self.error_log.error( "Failed to send error report http request returned status {}". format(status)) return status
def error_handler(self, continue_working, share, name, email): if share == 0: errorReporter = ErrorReporter("mantidplot", UsageService.getUpTime(), self._exit_code, True, str(name), str(email)) errorReporter.sendErrorReport() elif share == 1: errorReporter = ErrorReporter("mantidplot", UsageService.getUpTime(), self._exit_code, False, str(name), str(email)) errorReporter.sendErrorReport() if not continue_working: self.error_log.error("Terminated by user.") self._view.quit() else: self.error_log.error("Continue working.")