From b1a1750f95f65e87c1e455b988d5ed1e98fb4bd0 Mon Sep 17 00:00:00 2001 From: Joel Strait Date: Thu, 29 Dec 2022 11:21:11 -0800 Subject: [PATCH] Small improvements to error message wording In particular, the new wording includes the common name of the relevant format (i.e. WAVE_FORMAT_EXTENSIBLE), since the format code of 65534 might be cryptic on its own. --- lib/wavefile/chunk_readers/format_chunk_reader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wavefile/chunk_readers/format_chunk_reader.rb b/lib/wavefile/chunk_readers/format_chunk_reader.rb index 5ac3fe7..de40231 100644 --- a/lib/wavefile/chunk_readers/format_chunk_reader.rb +++ b/lib/wavefile/chunk_readers/format_chunk_reader.rb @@ -35,7 +35,7 @@ def read if format_chunk[:audio_format] == FORMAT_CODES[:extensible] if format_chunk[:extension_size] < 22 - raise_error InvalidFormatError, "The format chunk extension size of #{format_chunk[:extension_size]} bytes is too small. Since this format chunk has a format code of #{FORMAT_CODES[:extensible]}, the extension must be at least 22 bytes long." + raise_error InvalidFormatError, "The format chunk extension size of #{format_chunk[:extension_size]} bytes is too small. Since the format chunk has a format code of #{FORMAT_CODES[:extensible]} (i.e. WAVE_FORMAT_EXTENSIBLE), the extension size must be at least 22 bytes." end format_chunk[:valid_bits_per_sample] = raw_bytes.slice!(0...2).unpack(UNSIGNED_INT_16).first