Skip to content

Commit

Permalink
Improve open project error message (#1956)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo authored Jul 4, 2024
2 parents d5bcee1 + 54c7c5a commit 6dcb44c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions novelwriter/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,23 @@ def openProject(self, projPath: str | Path, clearLock: bool = False) -> bool:
status = self._storage.initProjectStorage(projPath, clearLock)
if status != NWStorageOpen.READY:
if status == NWStorageOpen.UNKOWN:
SHARED.error(self.tr("Not a known project file format."))
SHARED.error(
self.tr("Not a known project file format."),
info=self.tr("Path: {0}").format(str(projPath))
)
elif status == NWStorageOpen.NOT_FOUND:
SHARED.error(self.tr("Project file not found."))
SHARED.error(
self.tr("Project file not found."),
info=self.tr("Path: {0}").format(str(projPath))
)
elif status == NWStorageOpen.FAILED:
SHARED.error(
self.tr("Failed to open project."),
info=self.tr("Path: {0}").format(str(projPath)),
exc=self._storage.exc
)
elif status == NWStorageOpen.LOCKED:
self._state = NWProjectState.LOCKED
elif status == NWStorageOpen.FAILED:
SHARED.error(self.tr("Failed to open project."), exc=self._storage.exc)
return False

# Read Project XML
Expand Down

0 comments on commit 6dcb44c

Please sign in to comment.