From 732c5b00fc5cdc3f3606790d641b5644326acf49 Mon Sep 17 00:00:00 2001 From: Rong Ma Date: Wed, 27 Nov 2024 14:45:48 +0000 Subject: [PATCH] refine error message --- velox/common/compression/Compression.cpp | 7 ++++--- velox/common/compression/tests/CompressionTest.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/velox/common/compression/Compression.cpp b/velox/common/compression/Compression.cpp index 381bc29a64d61..784350ffb1726 100644 --- a/velox/common/compression/Compression.cpp +++ b/velox/common/compression/Compression.cpp @@ -134,8 +134,9 @@ Expected> Codec::create( return folly::makeUnexpected( Status::Invalid("Unrecognized codec '{}'", name)); } - return folly::makeUnexpected( - Status::Invalid("Support for codec '{}' not implemented.", name)); + return folly::makeUnexpected(Status::Invalid( + "Support for codec '{}' is either not built or not implemented.", + name)); } auto compressionLevel = codecOptions.compressionLevel; @@ -166,7 +167,7 @@ Expected> Codec::create( if (codec == nullptr) { return folly::makeUnexpected(Status::Invalid( - "Support for codec '{}' not implemented.", + "Support for codec '{}' is either not built or not implemented.", compressionKindToString(kind))); } diff --git a/velox/common/compression/tests/CompressionTest.cpp b/velox/common/compression/tests/CompressionTest.cpp index 30689092541bd..bce79b51f4634 100644 --- a/velox/common/compression/tests/CompressionTest.cpp +++ b/velox/common/compression/tests/CompressionTest.cpp @@ -371,7 +371,7 @@ TEST_P(CodecTest, specifyCompressionLevel) { VELOX_ASSERT_THROW( Codec::create(kind, kUseDefaultCompressionLevel), "Support for codec '" + compressionKindToString(kind) + - "' not implemented."); + "' is either not built or not implemented."); return; } auto codecDefault = Codec::create(kind).thenOrThrow(folly::identity);