You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error reporting differs at every layer of the pipeline — bool (dropping the reason), thrown std::runtime_error, thrown std::invalid_argument, and a status-enum-plus-string. This makes failures hard to surface uniformly and, for the block decoder, discards the reason a malformed stream was rejected.
Affected areas
src/codec/block/decoder.cpp
src/codec/lac/decoder.cpp
src/codec/lac/encoder.cpp
src/io/wav_io.cpp
src/main.cpp
Problem details
Block::Decoder::decode_into returns plain bool on every rejection, discarding which check failed — debug builds rely on LAC_DEBUG_* logging to recover any context.
LAC::Decoder::decode throws std::runtime_error with "[decode-error] ..." strings (decoder.cpp:26-33).
The CLI fast decode path returns a FastDecodeStatus enum plus an out-param std::string error (main.cpp:74-78,183-430).
The repo's stated direction is to "reject malformed input cleanly" and add malformed-input regression tests; a bool that loses the reason makes those tests assert only pass/fail and makes diagnostics depend on debug-only logging.
This is related to #7, which asks for consistent decode-time rejection of non-canonical metadata. This issue is the broader design question: one error/result strategy across encode, decode, I/O, and CLI.
Acceptance criteria
A single, documented error-reporting convention is chosen for the codec (e.g. a small Result/status type carrying a reason, or a consistent exception policy at the public boundary).
The block decoder can report why a stream was rejected without relying on NDEBUG-gated logging.
Summary
Error reporting differs at every layer of the pipeline —
bool(dropping the reason), thrownstd::runtime_error, thrownstd::invalid_argument, and a status-enum-plus-string. This makes failures hard to surface uniformly and, for the block decoder, discards the reason a malformed stream was rejected.Affected areas
src/codec/block/decoder.cppsrc/codec/lac/decoder.cppsrc/codec/lac/encoder.cppsrc/io/wav_io.cppsrc/main.cppProblem details
Block::Decoder::decode_intoreturns plainboolon every rejection, discarding which check failed — debug builds rely onLAC_DEBUG_*logging to recover any context.LAC::Decoder::decodethrowsstd::runtime_errorwith"[decode-error] ..."strings (decoder.cpp:26-33).LAC::Encoder::encodethrowsstd::invalid_argument(encoder.cpp:221-242).read_wav/write_wavreturnbool(wav_io.cpp).FastDecodeStatusenum plus an out-paramstd::string error(main.cpp:74-78,183-430).The repo's stated direction is to "reject malformed input cleanly" and add malformed-input regression tests; a
boolthat loses the reason makes those tests assert only pass/fail and makes diagnostics depend on debug-only logging.This is related to #7, which asks for consistent decode-time rejection of non-canonical metadata. This issue is the broader design question: one error/result strategy across encode, decode, I/O, and CLI.
Acceptance criteria
Result/status type carrying a reason, or a consistent exception policy at the public boundary).NDEBUG-gated logging.