Skip to content

Commit 4be1046

Browse files
committed
#144: utility: fix printing error code directly from enum
1 parent 3aeacf8 commit 4be1046

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vt-tv/utility/decompressor.impl.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ std::size_t Decompressor<Readable>::read(
128128
// we have hit an unknown error, print the code and corresponding message!
129129
auto error_code = BrotliDecoderGetErrorCode(dec_);
130130
auto error_str = fmt::format(
131-
"code={}, msg={}\n", error_code, BrotliDecoderErrorString(error_code));
131+
"code={}, msg={}\n",
132+
static_cast<typename std::underlying_type<decltype(error_code)>::type>(
133+
error_code
134+
),
135+
BrotliDecoderErrorString(error_code)
136+
);
132137
fmt::print(error_str);
133138
assert(false);
134139
break;

0 commit comments

Comments
 (0)