1.1.0 • Published 8 months ago

rpc-error v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

RPC errors

A class for handling RPC errors. Instances of RpcError are assumed to be public errors, which are safe to expose to the client.

import {RpcError} from 'rpc-error';

const error = RpcError.notFound();

Create a public "internal error":

const publicError = RpcError.from(privateError);

Create error using a custom code:

const error = RpcError.create('CUSTOM_ERROR_CODE');
1.1.0

8 months ago

1.0.0

8 months ago