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:
committed by
GitHub
parent
67d2e266fd
commit
00eea24e3f
@@ -37,6 +37,7 @@ from PyQt5.QtGui import (
|
||||
)
|
||||
|
||||
from novelwriter.enum import nwItemLayout, nwItemType
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.common import NWConfigParser, readTextFile
|
||||
from novelwriter.constants import nwLabels
|
||||
|
||||
@@ -250,7 +251,7 @@ class GuiTheme:
|
||||
confParser.read_file(inFile)
|
||||
except Exception:
|
||||
logger.error("Could not load theme settings from: %s", self.themeFile)
|
||||
novelwriter.logException()
|
||||
logException()
|
||||
return False
|
||||
|
||||
# Main
|
||||
@@ -310,7 +311,7 @@ class GuiTheme:
|
||||
confParser.read_file(inFile)
|
||||
except Exception:
|
||||
logger.error("Could not load syntax colours from: %s", self.syntaxFile)
|
||||
novelwriter.logException()
|
||||
logException()
|
||||
return False
|
||||
|
||||
# Main
|
||||
@@ -531,7 +532,7 @@ class GuiIcons:
|
||||
confParser.read_file(inFile)
|
||||
except Exception:
|
||||
logger.error("Could not load icon theme settings from: %s", themeConf)
|
||||
novelwriter.logException()
|
||||
logException()
|
||||
return False
|
||||
|
||||
# Main
|
||||
@@ -729,7 +730,7 @@ def _loadInternalName(confParser, confFile):
|
||||
confParser.read_file(inFile)
|
||||
except Exception:
|
||||
logger.error("Could not load file: %s", confFile)
|
||||
novelwriter.logException()
|
||||
logException()
|
||||
return ""
|
||||
|
||||
return confParser.rdStr("Main", "name", "")
|
||||
|
||||
Reference in New Issue
Block a user