mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-09-26 01:44:53 +00:00
Unix: preserve derived UI exception types
Check MissingArgument, NoItemSelected, and StringFormatterException before UserInterfaceException in both rethrow helpers. This prevents slicing and preserves their specific exception types and diagnostics.
This commit is contained in:
@@ -64,10 +64,11 @@ namespace VeraCrypt
|
||||
VC_CONVERT_EXCEPTION (UnsupportedSectorSizeNoKernelCrypto);
|
||||
VC_CONVERT_EXCEPTION (VolumeAlreadyMounted);
|
||||
VC_CONVERT_EXCEPTION (VolumeSlotUnavailable);
|
||||
VC_CONVERT_EXCEPTION (UserInterfaceException);
|
||||
// Handle UserInterfaceException subclasses before the base class to avoid slicing.
|
||||
VC_CONVERT_EXCEPTION (MissingArgument);
|
||||
VC_CONVERT_EXCEPTION (NoItemSelected);
|
||||
VC_CONVERT_EXCEPTION (StringFormatterException);
|
||||
VC_CONVERT_EXCEPTION (UserInterfaceException);
|
||||
VC_CONVERT_EXCEPTION (FilesystemDismountFailed);
|
||||
VC_CONVERT_EXCEPTION (ExecutedProcessFailed);
|
||||
VC_CONVERT_EXCEPTION (AlreadyInitialized);
|
||||
|
||||
@@ -1903,10 +1903,11 @@ const FileManager fileManagers[] = {
|
||||
VC_CONVERT_EXCEPTION (UnsupportedSectorSizeNoKernelCrypto);
|
||||
VC_CONVERT_EXCEPTION (VolumeAlreadyMounted);
|
||||
VC_CONVERT_EXCEPTION (VolumeSlotUnavailable);
|
||||
VC_CONVERT_EXCEPTION (UserInterfaceException);
|
||||
// Handle UserInterfaceException subclasses before the base class to avoid slicing.
|
||||
VC_CONVERT_EXCEPTION (MissingArgument);
|
||||
VC_CONVERT_EXCEPTION (NoItemSelected);
|
||||
VC_CONVERT_EXCEPTION (StringFormatterException);
|
||||
VC_CONVERT_EXCEPTION (UserInterfaceException);
|
||||
VC_CONVERT_EXCEPTION (FilesystemDismountFailed);
|
||||
VC_CONVERT_EXCEPTION (ExecutedProcessFailed);
|
||||
VC_CONVERT_EXCEPTION (AlreadyInitialized);
|
||||
|
||||
Reference in New Issue
Block a user