Skip to content

Commit

Permalink
feat(rpc): adds JSON-RPC error dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Oct 28, 2019
1 parent aa2835d commit d2d49ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/rpc/src/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { RPCSpecErrorType } from './types';

export const ErrorCodes: { [P in RPCSpecErrorType]: [number, string] } = {
ParseError: [-32700, 'A parsing error occurred on the server.'],
InvalidRequest: [-32600, 'Received an invalid request object.'],
MethodNotFound: [-32601, `The method couldn't be found.`],
InvalidParams: [-32602, 'Invalid method parameters.'],
InternalError: [-32603, 'Internal JSON-RPC error.']
};

0 comments on commit d2d49ad

Please sign in to comment.