Skip to content

Commit

Permalink
Linux/MaxOSX: correctly detect type of internal exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
idrassi committed Apr 6, 2015
1 parent 32f1100 commit ae28d51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Main/Forms/WaitDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ namespace VeraCrypt
void WaitDialog::ThrowException(Exception* 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 (PasswordKeyfilesIncorrect);
VC_CONVERT_EXCEPTION (PasswordOrKeyboardLayoutIncorrect);
Expand Down Expand Up @@ -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;
}
}
7 changes: 5 additions & 2 deletions src/Main/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit ae28d51

Please sign in to comment.