Skip to content

Commit

Permalink
#1469: util: improve error messages from Brotli
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jun 24, 2021
1 parent be62a55 commit c7d5099
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vt/utils/compress/decompressor.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,25 @@ std::size_t Decompressor<Readable>::read(
case BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:
{
// We need to read more to continue decoding
vtAssert(avail_in_ == 0, "Should not have more input if we need more");
vtAssert(avail_in_ == 0, "Brotli asked for more input even though we still had some.");
bool const has_more_input = getMoreInput();
if (not has_more_input) {
vtAbort("Needs more input to decompress but the file terminated early");
vtAbort("Brotli asked for more input but the file terminated early.");
}
break;
}
case BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:
{
// this is an expected condition
vtAssert(
avail_out == 0, "Available output should be 0 if we need more output"
avail_out == 0, "Brotli asked for more output even though we still had some."
);
break;
}
case BROTLI_DECODER_RESULT_SUCCESS:
{
if (avail_in_ != 0 or getMoreInput()) {
vtAbort("Decompressor terminated early before reading the whole file!");
vtAbort("Brotli terminated early before reading the whole file!");
}
success = true;
break;
Expand Down

0 comments on commit c7d5099

Please sign in to comment.