diff --git a/src/App/Application.cpp b/src/App/Application.cpp index af237eb1a..79ee1f321 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -30,6 +30,7 @@ # include # include # include +# include # if defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD) # include # include @@ -442,10 +443,21 @@ Document* Application::openDocument(const char * FileName) newDoc->restore(); return newDoc; } - catch (...) { + // if the project file itself is corrupt then + // close the document + catch (const Base::FileException&) { closeDocument(newDoc->getName()); throw; } + catch (const std::ios_base::failure&) { + closeDocument(newDoc->getName()); + throw; + } + // but for any other exceptions leave it open to give the + // user a chance to fix it + catch (...) { + throw; + } } Document* Application::getActiveDocument(void) const