An error answered by the server with a status and a message: thrown by endpoints and middlewares on the server
(estuary-rpc-server answers it as { status: "error", message } with its status), and by estuary-rpc-client when
a call is answered so, with the status kept.
Example
if (!book) thrownewApiError(HTTP_STATUS_CODES.NOT_FOUND, "No such book");
Whether a value is an ApiError, even one made by another copy of estuary-rpc (two installs, or a
bundler's copy beside Node's), where instanceof says no.
An error answered by the server with a status and a message: thrown by endpoints and middlewares on the server (estuary-rpc-server answers it as
{ status: "error", message }with its status), and by estuary-rpc-client when a call is answered so, with the status kept.Example