From ae28d510163d6108f3746ee1e5d64d00350ac8ee Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 6 Apr 2015 18:51:14 +0200 Subject: [PATCH] Linux/MaxOSX: correctly detect type of internal exceptions --- src/Main/Forms/WaitDialog.cpp | 8 ++++---- src/Main/UserInterface.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Main/Forms/WaitDialog.cpp b/src/Main/Forms/WaitDialog.cpp index 4fc6f60d16..048bb91f2c 100644 --- a/src/Main/Forms/WaitDialog.cpp +++ b/src/Main/Forms/WaitDialog.cpp @@ -29,10 +29,6 @@ namespace VeraCrypt void WaitDialog::ThrowException(Exception* ex) { #define VC_CONVERT_EXCEPTION(NAME) if (dynamic_cast (ex)) throw (NAME&) *ex; - VC_CONVERT_EXCEPTION (SystemException); - VC_CONVERT_EXCEPTION (CipherException); - VC_CONVERT_EXCEPTION (VolumeException); - VC_CONVERT_EXCEPTION (PasswordException); VC_CONVERT_EXCEPTION (PasswordIncorrect); VC_CONVERT_EXCEPTION (PasswordKeyfilesIncorrect); VC_CONVERT_EXCEPTION (PasswordOrKeyboardLayoutIncorrect); @@ -96,6 +92,10 @@ namespace VeraCrypt VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound); VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode); VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat); + VC_CONVERT_EXCEPTION (SystemException); + VC_CONVERT_EXCEPTION (CipherException); + VC_CONVERT_EXCEPTION (VolumeException); + VC_CONVERT_EXCEPTION (PasswordException); throw *ex; } } diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index a081978700..62966e770f 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -1588,9 +1588,12 @@ namespace VeraCrypt VC_CONVERT_EXCEPTION (SecurityTokenLibraryNotInitialized); VC_CONVERT_EXCEPTION (SecurityTokenKeyfileAlreadyExists); VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound); - VC_CONVERT_EXCEPTION (SystemException); - VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode); + VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode); VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat); + VC_CONVERT_EXCEPTION (SystemException); + VC_CONVERT_EXCEPTION (CipherException); + VC_CONVERT_EXCEPTION (VolumeException); + VC_CONVERT_EXCEPTION (PasswordException); throw *ex; } }