Contributor: Theo Gravity
- Add
withRequestId()
/getRequestId()
toBaseError
Contributor: dependabot[bot]
- Bump minimatch from 3.0.4 to 3.1.2 (#25)
Contributor: Theo Gravity
- Update dev deps, export IBaseErrorConfig interface (#24)
This includes the IBaseErrorConfig interface as a mainline export
Contributor: Theo Gravity
- Fix onConvert() failing in certain situations (#23)
Contributor: dependabot[bot]
- Bump tmpl from 1.0.4 to 1.0.5 (#22)
Bumps tmpl from 1.0.4 to 1.0.5.
updated-dependencies:
- dependency-name: tmpl dependency-type: indirect ...
Signed-off-by: dependabot[bot] support@github.com
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Contributor: Theo Gravity
- [minor] Add config option to append attached error message to main error message (#21)
Added a BaseError
config option, appendWithErrorMessageFormat
, which
will append the attached error message to the main error message. Useful
for testing frameworks like Jest, which will not print the attached message.
Contributor: dependabot[bot]
- Bump browserslist from 4.16.3 to 4.16.6 (#17)
Bumps browserslist from 4.16.3 to 4.16.6.
Signed-off-by: dependabot[bot] support@github.com
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Contributor: dependabot[bot]
- Bump hosted-git-info from 2.8.8 to 2.8.9 (#16)
Contributor: dependabot[bot]
- Bump lodash from 4.17.20 to 4.17.21 (#15)
Bumps lodash from 4.17.20 to 4.17.21.
Signed-off-by: dependabot[bot] support@github.com
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Theo Gravity theo@suteki.nu
Contributor: dependabot[bot]
- Bump handlebars from 4.7.6 to 4.7.7 (#14)
Bumps handlebars from 4.7.6 to 4.7.7.
Signed-off-by: dependabot[bot] support@github.com
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Contributor: dependabot[bot]
- Bump y18n from 4.0.0 to 4.0.1 (#13)
Contributor: Theo Gravity
- Fix
BaseError#setConfig()
not being chainable
It was returning void rather than the instance back. This fixes that.
Contributor: Theo Gravity
- Fix typescript intelligence on
ErrorRegistry#withContext()
The return type of withContext()
was being inferred as any
by Typescript. This now appropriately set to return ErrorRegistry<HLErrors, LLErrors>
.
Contributor: Theo Gravity
- Update readme
Contributor: Theo Gravity
- Update readme
Contributor: Theo Gravity
- Add the ability to create child error registries
You can now create child registries with context via ErrorRegistry#withContext()
that will create
errors with the predefined context.
The use-case is if your code block throws many errors, and you want to use the same metadata without setting it each time, so code is not duplicated.
See readme for more information.
Contributor: Theo Gravity
- Improve readme for Apollo GraphQL
The instructions for Apollo GraphQL was not correct and has been updated with an internally tested example.
Contributor: Theo Gravity
- New major version: v2 (#12)
For most users, this new major version should not break your existing code.
You may have to make adjustments if you happen to use generics in ErrorRegistry
.
- Potentially breaking: Refactor
ErrorRegistry
generics by removing unused generics and moving the definitions to an interface - Added the ability to define a
message
in a high level definition. This is used withErrorRegistry#newBareError
if no message is defined. - Made the
message
parameter ofErrorRegistry#newBareError
optional. See readme for behavior when the parameter is omitted.
Contributor: Theo Gravity
- Add the ability to convert an error to another type (#11)
This is useful if you need to convert the errors created by this library into another type, such as a GraphQLError
when going outbound to the client.
See the README for more details.
Contributor: Theo Gravity
- Fix typescript error when using utility helpers with registry and calling newError
Contributor: Theo Gravity
- Add helper utilities for registry definitions
Two utility methods have been defined:
generateHighLevelErrors()
generateLowLevelErrors()
See readme for more details.
Contributor: Theo Gravity
- Update readme
Contributor: Theo Gravity
- Add
ErrorRegistry
config optiononCreateError
You can now globally modify new errors created from the error registry via the onCreateError
handler.
Contributor: Theo Gravity
- Clean up stack traces
If you are calling ErrorRegistry#newError
or related functions to create errors, the stack trace includes an ErrorRegistry
entry. This change removes that entry for easier readability.
Contributor: Theo Gravity
- Fix bug where specifying something other than an array for toJSON/toJSONSafe throws
Contributor: Theo Gravity
- Update readme
Fix handler example, add config usage
Contributor: Theo Gravity
- Add toJSON / toJSONSafe post-processing handler options (#10)
You can now perform post-processing on serialized data via onPreToJSONData
/ onPreToJSONDataSafe
options. See readme for more details.
Contributor: Theo Gravity
- Add option to not include empty metadata on serialization (#9)
This adds omitEmptyMetadata
to the BaseError
configuration.
Contributor: Theo Gravity
- Add configuration options for ErrorRegistry / BaseError (#8)
New configuration options have been added to the ErrorRegistry and BaseError. See readme for more details.
Contributor: Theo Gravity
- Fix README.md
Contributor: Theo Gravity
- Add deserialization support (#7)
- Include
logLevel
as part oftoJSON()
- Fix interface definitions and examples
Please read the README section on the limitations and security issues relating to deserialization.
Contributor: Theo Gravity
- Add support for defining log levels
This adds the logLevel
property to the error definitions along with
corresponding getLogLevel()
and withLogLevel()
methods.
There are cases where certain errors do not warrant being logged
under an error
log level when combined with a logging system.
Contributor: Theo Gravity
- Update README.md
Fix npm badge from http->https to fix render issues on the npm page
Contributor: Theo Gravity
- Add
withErrorId()
,getErrorId()
methods
These methods were added to help cross-refeference an error between systems. The readme has been updated with usage and an example on a best-practice situation.
Contributor: Theo Gravity
- Add new methods and documentation (#4)
Added:
BaseError#getErrorType()
BaseError#getErrorName()
Contributor: Theo Gravity
- Add missing methods to
IBaseError
(#3)
Contributor: Theo Gravity
- Update readme with more examples
Contributor: Theo Gravity
- Update readme with use-cases
Contributor: Theo Gravity
-
[minor] Concrete class-based support (#1)
-
Added examples on how to work with the library without the registry
-
Updated and exported some interfaces to assist with class-based creation
Contributor: Theo Gravity
- Add getters / more examples / improved docs
Contributor: Theo Gravity
- CI fixes.
Contributor: Theo Gravity
- First version