summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLubos Dolezel <lubos@dolezel.info>2015-07-23 15:55:42 +0200
committerLubos Dolezel <lubos@dolezel.info>2015-07-23 15:55:42 +0200
commit138a8dc8085fbd302fdf3b1b8c0af640b6e8579d (patch)
treed2aa59998b5b21bf60a22eed925f433192a9535f /src
parent176ade13f1b765b6c8a0c881b0a09d4ebf86699a (diff)
downloadtwinkle-138a8dc8085fbd302fdf3b1b8c0af640b6e8579d.tar
twinkle-138a8dc8085fbd302fdf3b1b8c0af640b6e8579d.tar.gz
twinkle-138a8dc8085fbd302fdf3b1b8c0af640b6e8579d.tar.lz
twinkle-138a8dc8085fbd302fdf3b1b8c0af640b6e8579d.tar.xz
twinkle-138a8dc8085fbd302fdf3b1b8c0af640b6e8579d.zip
Print more information on unhandled exceptions
Diffstat (limited to 'src')
-rw-r--r--src/gui/main.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index 529052e..a3ced2b 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -1046,6 +1046,24 @@ int main( int argc, char ** argv )
ui->cb_show_msg(msg, MSG_CRITICAL);
sys_config->delete_lock_file();
exit(1);
+ } catch (int e) {
+ string msg = "Error code exception: ";
+ msg += e;
+ log_file->write_report(msg, "::main", LOG_NORMAL, LOG_CRITICAL);
+ ui->cb_show_msg(msg, MSG_CRITICAL);
+ sys_config->delete_lock_file();
+ exit(1);
+ } catch (const std::exception& e) {
+ string msg = "std::exception exception: ";
+ msg += e.what();
+ msg += " (";
+ msg += typeid(e).name();
+ msg += ")";
+
+ log_file->write_report(msg, "::main", LOG_NORMAL, LOG_CRITICAL);
+ ui->cb_show_msg(msg, MSG_CRITICAL);
+ sys_config->delete_lock_file();
+ exit(1);
} catch (...) {
string msg = "Unknown exception";
log_file->write_report(msg, "::main", LOG_NORMAL, LOG_CRITICAL);