From 3b685288d36035e2e6b4c8d9c604fb0b35b727ad Mon Sep 17 00:00:00 2001 From: Blake-Madden Date: Fri, 29 Sep 2023 17:36:02 -0400 Subject: [PATCH] Log warning about failing to load images that are cloud files that aren't available This happens when you try to open a file, but aren't connected to the internet and the file is only available via the cloud service. --- src/base/image.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/base/image.cpp b/src/base/image.cpp index 54e0ee83..64ff120a 100644 --- a/src/base/image.cpp +++ b/src/base/image.cpp @@ -882,6 +882,15 @@ namespace Wisteria::GraphItems return image; } + // weird exception that auto-buffering won't help, so explain it to the user + catch (const MemoryMappedFileCloudFileError&) + { + wxLogWarning( + wxString::Format(_(L"%s: unable to open file from Cloud service."), + filePath), + _(L"Error"), wxOK|wxICON_EXCLAMATION); + return wxNullImage; + } catch (...) { return wxNullImage; } }