rpc-error
v1.1.0
Published
Error class for RPC errors.
Readme
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');