Skip to content

zlib: improve zlib errors

zlib: improve zlib errors

  • Use assert to check mode in the Zlib constructor since it should only be passed by us.
  • Introduce checkRangesOrGetDefault() and checkFiniteNumber() to simplify type and range checking for numeric arguments
  • Instead of ERR_INVALID_OPT_VALUE, throw ERR_OUT_OF_RANGE and ERR_INVALID_ARG_TYPE with descriptions of the expected ranges or types to make the errors more user-friendly.
  • Add message tests for the changed errors
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

zlib

Merge request reports

Loading