@infinitescroll/streams-errors

0.0.1-alpha.10 • Public • Published

Adding new errors to this package:

  1. Go to RPCErrorCodes.ts and add the new code and message to the RPCErrorCodes object. The number used must be less than -32001 (it should just be the next number down from the last error code, serially). The message should be unique.
  2. Go to errors.ts and add a new named class that extends the RPCError, passing the new error code you just created. For example:
export class TheErrorYouJustCreated extends RPCError {
  constructor({ ...args } = {}) {
    super({ code: '-code you just created', ...args })
  }
}
  1. Go to handleErr function, and make a case for your error to be handled.

Readme

Keywords

none

Package Sidebar

Install

npm i @infinitescroll/streams-errors

Weekly Downloads

1

Version

0.0.1-alpha.10

License

(Apache-2.0 OR MIT)

Unpacked Size

21.2 kB

Total Files

18

Last publish

Collaborators

  • schwartzz8990