import * as tpy from "https://deno.land/x/tpy@v1.0.0-RC/src/error.ts";
Tpy's library specific error interface, provides more specific and helpful messages along with direct context with what caused the error.
It is made to be disected and verifiable, as it only comes with
set possible outcomes derived from TpyErrors
.
Example Error
try {
// ...
} catch (e) {
if (e instanceof TpyError)
console.error(`There was an error! ${e.name}: ${e.message()}`);
// Handle if e suits other Error interfaces.
}
Type casting e
implies e
will only ever return a TpyError
.
TpyError
does not catch all errors, it should catch most errors
regarding the request, though.
Classes
An error wrapper of |
Variables
The set of errors returned by |
Functions
Creates a string that describes the parameter(s) are either missing or incompatible. | |
Clarifies that the string is the response body. | |
Clarifies that the string is the HTTP response code. |