1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Linux/MaxOSX: correctly detect type of internal exceptions

This commit is contained in:
Mounir IDRASSI
2015-04-06 18:51:14 +02:00
parent 32f11001c0
commit ae28d51016
2 changed files with 9 additions and 6 deletions

View File

@@ -29,10 +29,6 @@ namespace VeraCrypt
void WaitDialog::ThrowException(Exception* ex) void WaitDialog::ThrowException(Exception* ex)
{ {
#define VC_CONVERT_EXCEPTION(NAME) if (dynamic_cast<NAME*> (ex)) throw (NAME&) *ex; #define VC_CONVERT_EXCEPTION(NAME) if (dynamic_cast<NAME*> (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 (PasswordIncorrect);
VC_CONVERT_EXCEPTION (PasswordKeyfilesIncorrect); VC_CONVERT_EXCEPTION (PasswordKeyfilesIncorrect);
VC_CONVERT_EXCEPTION (PasswordOrKeyboardLayoutIncorrect); VC_CONVERT_EXCEPTION (PasswordOrKeyboardLayoutIncorrect);
@@ -96,6 +92,10 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound); VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound);
VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode); VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat); VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat);
VC_CONVERT_EXCEPTION (SystemException);
VC_CONVERT_EXCEPTION (CipherException);
VC_CONVERT_EXCEPTION (VolumeException);
VC_CONVERT_EXCEPTION (PasswordException);
throw *ex; throw *ex;
} }
} }

View File

@@ -1588,9 +1588,12 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (SecurityTokenLibraryNotInitialized); VC_CONVERT_EXCEPTION (SecurityTokenLibraryNotInitialized);
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileAlreadyExists); VC_CONVERT_EXCEPTION (SecurityTokenKeyfileAlreadyExists);
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound); VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound);
VC_CONVERT_EXCEPTION (SystemException); VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat); VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat);
VC_CONVERT_EXCEPTION (SystemException);
VC_CONVERT_EXCEPTION (CipherException);
VC_CONVERT_EXCEPTION (VolumeException);
VC_CONVERT_EXCEPTION (PasswordException);
throw *ex; throw *ex;
} }
} }