Use the logException function in all places where exception messages are written to the error log

This commit is contained in:
Veronica K. B. Olsen
2021-01-29 18:29:50 +01:00
parent a2f223a992
commit 89ba4aeeaf
11 changed files with 72 additions and 63 deletions
+6 -6
View File
@@ -671,9 +671,9 @@ class GuiBuildNovel(QDialog):
bldObj.doConvert()
bldObj.doPostProcessing()
except Exception as e:
except Exception:
logger.error("Failed to generate html of document '%s'" % tItem.itemHandle)
logger.error(str(e))
nw.logException()
if isPreview:
self.docView.setText((
"Failed to generate preview. "
@@ -997,9 +997,9 @@ class GuiBuildNovel(QDialog):
with open(buildCache, mode="r", encoding="utf8") as inFile:
theJson = inFile.read()
theData = json.loads(theJson)
except Exception as e:
except Exception:
logger.error("Failed to load build cache")
logger.error(str(e))
nw.logException()
return False
if "htmlText" in theData.keys():
@@ -1026,9 +1026,9 @@ class GuiBuildNovel(QDialog):
"htmlStyle" : self.htmlStyle,
"buildTime" : self.buildTime,
}, indent=2))
except Exception as e:
except Exception:
logger.error("Failed to save build cache")
logger.error(str(e))
nw.logException()
return False
return True