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:
Mounir IDRASSI
2026-09-25 12:24:28 +02:00
parent d3bb431de2
commit 266a892cda
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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);
+2 -1
View File
@@ -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);