Error logging and mutables as function defaults (#930)

* Remove mutable iterables as function defaults
* Improve error reporting and standardise how it's done
This commit is contained in:
Veronica Berglyd Olsen
2021-11-10 00:32:01 +01:00
committed by GitHub
parent 67d2e266fd
commit 00eea24e3f
15 changed files with 88 additions and 65 deletions
+2 -1
View File
@@ -41,6 +41,7 @@ from PyQt5.QtWidgets import (
from novelwriter.core import ToHtml
from novelwriter.enum import nwAlert, nwItemType, nwDocAction
from novelwriter.error import logException
from novelwriter.constants import nwUnicode
logger = logging.getLogger(__name__)
@@ -185,7 +186,7 @@ class GuiDocViewer(QTextBrowser):
aDoc.doPostProcessing()
except Exception:
logger.error("Failed to generate preview for document with handle '%s'", tHandle)
novelwriter.logException()
logException()
self.setText(self.tr("An error occurred while generating the preview."))
return False