From ca85c5d14314b4d6701069dbcbc44d1f576019f2 Mon Sep 17 00:00:00 2001 From: theGreatWhiteShark Date: Wed, 22 Jan 2025 20:15:32 +0100 Subject: [PATCH] gui/main: fix exception handling when provoking an exception during debugging I was quite surprised we did neither show the `Reporter` nor return with a non-zero exit code. --- ChangeLog | 2 ++ src/gui/src/main.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9cacef8bce..d6fd26f9e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ XXXX-XX-XX the hydrogen team * Fixed - Fix compilation with LASH support enabled (#2076). - Fix Hue slider in Preferences > Appearance > Color (#2081) + - Show the Crash Reporter and exit with return code `1` on unhandled + exceptions. 2024-12-07 the hydrogen team * Release 1.2.4 diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index e1319c3961..ec1ce52185 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -561,9 +561,11 @@ int main(int argc, char *argv[]) } catch ( const H2Core::H2Exception& ex ) { std::cerr << "[main] Exception: " << ex.what() << std::endl; + return 1; } catch (...) { std::cerr << "[main] Unknown exception X-(" << std::endl; + return 1; } return 0;