Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions friture/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def __init__(self):

# exception hook that logs to console, file, and display a message box
def excepthook(self, exception_type, exception_value, traceback_object):
# a keyboard interrupt is an intentional exit, so close the application
if exception_type is KeyboardInterrupt:
self.close()
exit(0)

gui_message = fileexcepthook(exception_type, exception_value, traceback_object)

# we do not want to flood the user with message boxes when the error happens repeatedly on each timer event
Expand Down
24 changes: 12 additions & 12 deletions friture/exceptionhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ def fileexcepthook(exception_type, exception_value, traceback_object):

email = "contact@friture.org"

notice = \
"""<h1>Opps! Something went wrong!</h1>\n\n"""\
"""<p>Sorry, there was an error we could not handle.</p>"""\
"""<p>You can choose to abort, or to ignore the error and try to continue """\
"""(this is not guaranteed to work).</p>"""\
"""<h2>Please help us fix it!</h2>\n\n"""\
"""<p>Please contact us directly via email at <a href="mailto:%s?Subject=Friture%%20acrash report">%s</a> """\
"""and include the log file named <i>%s</i> from the following folder:</p>"""\
"""<p><a href="file:///%s">%s</a></p>"""\
"""<p>Alternatively, if you have a GitHub account, you can create a new issue on <a href="https://github.com/tlecomte/friture/issues">https://github.com/tlecomte/friture/issues</a></p>"""\
"""<h3>Error details</h3>""" % \
(email, email, logFileName, logDir, logDir)
notice = """
<h1>Oops! Something went wrong!</h1>
<p>Sorry, there was an error we could not handle.</p>
<p>You can choose to abort, or to ignore the error and try to continue
(this is not guaranteed to work).</p>
<h2>Please help us fix it!</h2>\n\n
<p>Please contact us directly via email at <a href="mailto:{email}?Subject=Friture%%20acrash report">{email}</a>
and include the log file named <i>{logFileName}</i> from the following folder:</p>
<p><a href="file:///{logDir}">{logDir}1</a></p>
<p>Alternatively, if you have a GitHub account, you can create a new issue on <a href="https://github.com/tlecomte/friture/issues">https://github.com/tlecomte/friture/issues</a></p>
<h3>Error details</h3>""" \
.format(email = email, logFileName = logFileName, logDir = logDir)

msg = notice + timeString + ' (%s)' % versionInfo + '<br>' + exceptionText.replace("\r\n", "\n").replace("\n", "<br>").replace(" ", '&nbsp;')

Expand Down