From 459b9e317dd73a609056d77b8605bb9a01a08432 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 25 Aug 2010 19:31:11 +0000 Subject: [PATCH] Display an error when the config file is corrupted rather than just crashing Originally committed to SVN as r4751. --- aegisub/src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index 50cb1dfd2..4e6b9f5c5 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -184,7 +184,12 @@ bool AegisubApp::OnInit() { // Might be worth displaying an error in the second case } #endif - config::opt->ConfigUser(); + try { + config::opt->ConfigUser(); + } + catch (agi::Exception const& err) { + wxMessageBox(L"Configuration file is invalid. Error reported:\n" + lagi_wxString(err.GetMessage()), L"Error"); + } #ifdef __VISUALC__