Added more infor to the error dialog
This commit is contained in:
+23
-6
@@ -29,8 +29,11 @@ def formatHtmlErrMsg(exType, exValue, exTrace):
|
|||||||
"""Generates a HTML version of an exception.
|
"""Generates a HTML version of an exception.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
import sys
|
||||||
from traceback import format_tb
|
from traceback import format_tb
|
||||||
from nw import __issuesurl__
|
from nw import __issuesurl__, __version__
|
||||||
|
from PyQt5.Qt import PYQT_VERSION_STR
|
||||||
|
from PyQt5.QtCore import QT_VERSION_STR, QSysInfo
|
||||||
|
|
||||||
fmtTrace = ""
|
fmtTrace = ""
|
||||||
for trEntry in format_tb(exTrace):
|
for trEntry in format_tb(exTrace):
|
||||||
@@ -41,11 +44,25 @@ def formatHtmlErrMsg(exType, exValue, exTrace):
|
|||||||
|
|
||||||
theMessage = (
|
theMessage = (
|
||||||
"<p>Please report this error by submitting an issue report on "
|
"<p>Please report this error by submitting an issue report on "
|
||||||
"GitHub, providing a description and this error message.</p>"
|
"GitHub, providing a description and this error message. "
|
||||||
"<p><b>Issue Tracker</b><br>%s</p>"
|
"URL: <{issueUrl}>.</p>"
|
||||||
"<p><b>Error Type</b><br>%s: %s</p>"
|
"<p><b>Environment</b><br>Version: {nwVersion}, OS: {osType} ({osKernel}),"
|
||||||
"<p><b>Traceback</b><br>%s</p>"
|
"Python: {pyVersion} ({pyHexVer:#x}), Qt: {qtVers}, PyQt: {pyqtVers}</p>"
|
||||||
) % (__issuesurl__, exType.__name__, str(exValue), fmtTrace)
|
"<p><b>Error Type</b><br>{exType}: {exMessage}</p>"
|
||||||
|
"<p><b>Traceback</b><br>{exTrace}</p>"
|
||||||
|
).format(
|
||||||
|
nwVersion = __version__,
|
||||||
|
osType = sys.platform,
|
||||||
|
osKernel = QSysInfo.kernelVersion(),
|
||||||
|
pyVersion = sys.version.split()[0],
|
||||||
|
pyHexVer = sys.hexversion,
|
||||||
|
qtVers = QT_VERSION_STR,
|
||||||
|
pyqtVers = PYQT_VERSION_STR,
|
||||||
|
issueUrl = __issuesurl__,
|
||||||
|
exType = exType.__name__,
|
||||||
|
exMessage = str(exValue),
|
||||||
|
exTrace = fmtTrace
|
||||||
|
)
|
||||||
|
|
||||||
return theMessage
|
return theMessage
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user