diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 89d51c2d9..4b3e4bdfb 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -72,7 +72,7 @@ AssFile::~AssFile() { } void AssFile::Load (const wxString &_filename,wxString charset,bool addToRecent) { - bool ok = true; + bool ok = false; try { // Try to open file @@ -102,6 +102,7 @@ void AssFile::Load (const wxString &_filename,wxString charset,bool addToRecent) if (reader) { reader->SetTarget(this); reader->ReadFile(_filename,charset); + ok = true; } // Couldn't find a type @@ -111,18 +112,20 @@ void AssFile::Load (const wxString &_filename,wxString charset,bool addToRecent) // String error catch (const wchar_t *except) { wxMessageBox(except,_T("Error loading file"),wxICON_ERROR | wxOK); - ok = false; } catch (wxString except) { wxMessageBox(except,_T("Error loading file"),wxICON_ERROR | wxOK); - ok = false; + } + + // Real exception + catch (agi::Exception &e) { + wxMessageBox(wxString(e.GetChainedMessage().c_str(), wxConvUTF8), L"Error loading file", wxICON_ERROR|wxOK); } // Other error catch (...) { wxMessageBox(_T("Unknown error"),_T("Error loading file"),wxICON_ERROR | wxOK); - ok = false; } // Verify loading