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
, throwERR_OUT_OF_RANGE
andERR_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), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
zlib