`modern-errors` plugin to serialize/parse errors.
MIT License
include
and exclude
options to pick/omit specific properties. For example, this can be used to omit error additional properties or stack trace.transformObject(errorObject)
option to transform the error plain object during serializationtransformArgs(constructorArgs)
option to transform the error message during parsingtransformInstance(errorInstance)
option to transform the error instance during parsingPublished by ehmicky 12 months ago
18.18.0
Published by ehmicky over 1 year ago
modern-errors
version is now 6.0.0
Published by ehmicky over 1 year ago
16.17.0
Published by ehmicky almost 2 years ago
BaseError.toJSON()
was renamed to BaseError.serialize()
BaseError.fromJSON()
was renamed to BaseError.parse()
shallow
option to serialize/parse shallowlyloose
option to prevent converting the argument to an error instance or an error plain object if it is not onePublished by ehmicky almost 2 years ago
error.fromJSON()
and error.serialize()
Published by ehmicky almost 2 years ago
error.toJSON()
has been renamed to BaseError.toJSON(error)
Published by ehmicky almost 2 years ago
modern-errors
Published by ehmicky almost 2 years ago
modern-errors@5
is now requiredBaseError.parse(value)
is not an error object, it is not converted to one anymore. Also, if it is an unknown error, it is not normalized anymore.custom
option and a constructor
is defined, that constructor is not called anymore. However, any property previously set by that constructor is still preserved, providing it is serializable and enumerable.constructorArgs
, the plugins options are now serialized as pluginsOpts
. Those properties are undocumented and mostly internal.Published by ehmicky almost 2 years ago
Published by ehmicky almost 2 years ago
Published by ehmicky almost 2 years ago
modern-errors@v4
Published by ehmicky almost 2 years ago
Improve README
.
Published by ehmicky almost 2 years ago
Initial release.