Add trycatch around whatsnew & changelog pages

Fixes CURA-4DX (sentry crash)
This commit is contained in:
Jaime van Kessel 2022-09-06 14:43:38 +02:00
parent f2edc1ac49
commit 6c0d76807e
No known key found for this signature in database
GPG key ID: C85F7A3AF1BAA7C4

View file

@ -62,15 +62,21 @@ class WhatsNewPagesModel(WelcomePagesModel):
def initialize(self) -> None:
self._pages = []
self._pages.append({"id": "whats_new",
"page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"),
"next_page_button_text": self._catalog.i18nc("@action:button", "Skip"),
"next_page_id": "changelog"
})
self._pages.append({"id": "changelog",
"page_url": self._getBuiltinWelcomePagePath("ChangelogContent.qml"),
"next_page_button_text": self._catalog.i18nc("@action:button", "Close"),
})
try:
self._pages.append({"id": "whats_new",
"page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"),
"next_page_button_text": self._catalog.i18nc("@action:button", "Skip"),
"next_page_id": "changelog"
})
except FileNotFoundError:
Logger.warning("Unable to find what's new page")
try:
self._pages.append({"id": "changelog",
"page_url": self._getBuiltinWelcomePagePath("ChangelogContent.qml"),
"next_page_button_text": self._catalog.i18nc("@action:button", "Close"),
})
except FileNotFoundError:
Logger.warning("Unable to find changelog page")
self.setItems(self._pages)
images, max_image = WhatsNewPagesModel._collectOrdinalFiles(Resources.Images, WhatsNewPagesModel.image_formats)