- Minimal supported Node.js version is now
18.18.0
- Minimal supported Node.js version is now
16.17.0
- Improve tree-shaking support
- Add browser support
- Fix
package.json
- Switch to MIT license
- Improve TypeScript types
- Remove unused dependency
- Error
props
are not set anymore. Please useset-error-props
instead.
- Error
props
are now deep merged
- The
onCreate
andParentClass
options have been removed. Please useerror-class-utils
instead.
- The
onCreate
andParentClass
positional parameters are now named parameters inside an options object.
- Allow specifying the parent error class
- The project was renamed from
error-type
toerror-custom-class
- Error properties are now set by default using
new CustomError('message', { props: { ... } })
instead ofnew CustomError('message', { ... })
- Fix types
- Split
ErrorType
type intoErrorConstructor
andErrorInstance
- Add a template parameter
ErrorName
to all types
- Fix main function's return value's type
- Reduce npm package size
- Do not allow errors named 'Warning' or 'UnhandledPromiseRejection'