2.0.1 - 2022-11-17
withCode(code?)
: makecode
argument optional
2.0.0 - 2022-11-17
- add an optional
options
argument to the constructor allowing you to pass through acause
try { throw new Error('Authentication token expired') } catch (error: any) { throw new Error('User login failed', { cause: error }) }
- add
HttpError#withStack
method: assign a specific stack trace to this error
- bump dependencies
- use UVU and expect for testing instead of tap
- use
@supercharge/eslint-config-typescript
instead ofstandard-with-typescript
- require Node.js v16, drop support for Node.js v12 and v14
- remove the
status
andcode
arguments from theHttpError
constructorimport { HttpError } from '@supercharge/errors' // before const error = new HttpError('Authentication token expired', 401, 'AUTH_TOKEN_EXPIRED') // now const error = new HttpError('Authentication token expired', { cause }) .withStatus(401) .withCode('AUTH_TOKEN_EXPIRED')
1.3.0 - 2021-08-27
- bump dependencies
- make
status
argument optional and default to 500 inHttpError
1.2.0 - 2021-08-20
- public
stack
property to theError
class ensuring the stacktrace is available
1.1.0 - 2021-08-20
withTitle(title: string)
method to add a title to the error instance. For example, a title can beBad Request
for a 400 error
- bump dependencies
1.0.0
release 🚀 🎉