From 1fd212016e867850267eea44bc09c8df1aff8ca4 Mon Sep 17 00:00:00 2001 From: alt3r 3go Date: Sun, 1 Dec 2019 14:26:38 +0100 Subject: UNIX: make sector size mismatch error more verbose (#552) (#561) Signed-off-by: alt3r 3go --- src/Core/Unix/CoreUnix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Core') diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp index 372c450f..423b5655 100644 --- a/src/Core/Unix/CoreUnix.cpp +++ b/src/Core/Unix/CoreUnix.cpp @@ -473,8 +473,10 @@ namespace VeraCrypt if (options.Path->IsDevice()) { - if (volume->GetFile()->GetDeviceSectorSize() != volume->GetSectorSize()) - throw ParameterIncorrect (SRC_POS); + const uint32 devSectorSize = volume->GetFile()->GetDeviceSectorSize(); + const size_t volSectorSize = volume->GetSectorSize(); + if (devSectorSize != volSectorSize) + throw DeviceSectorSizeMismatch (SRC_POS, StringConverter::ToWide(devSectorSize) + L" != " + StringConverter::ToWide(volSectorSize)); } // Find a free mount point for FUSE service -- cgit v1.2.3