GHOST/Wayland: print the exception message on failure

When GHOST_SystemWayland can't be created, print the run-time error
unless X11 is available as a fallback.
This commit is contained in:
Campbell Barton 2023-08-22 16:08:55 +10:00
parent 920271da42
commit f58d596c36
1 changed files with 8 additions and 2 deletions

View File

@ -64,7 +64,10 @@ GHOST_TSuccess GHOST_ISystem::createSystem(bool verbose, [[maybe_unused]] bool b
try {
m_system = new GHOST_SystemWayland(background);
}
catch (const std::runtime_error &) {
catch (const std::runtime_error &e) {
if (verbose) {
fprintf(stderr, "GHOST: %s\n", e.what());
}
delete m_system;
m_system = nullptr;
# ifdef WITH_GHOST_WAYLAND_DYNLOAD
@ -102,7 +105,10 @@ GHOST_TSuccess GHOST_ISystem::createSystem(bool verbose, [[maybe_unused]] bool b
try {
m_system = new GHOST_SystemWayland(background);
}
catch (const std::runtime_error &) {
catch (const std::runtime_error &const e) {
if (verbose) {
fprintf(stderr, "GHOST: %s\n", e.what());
}
delete m_system;
m_system = nullptr;
# ifdef WITH_GHOST_WAYLAND_DYNLOAD