import { Context } from "https://deno.land/x/doa@v1.0.0/context.ts";
Constructors
Index Signatures
key: string]: any
[Methods
assert()
value: any,
status: number,
message?: string,
props?: object,
Assert condition,creates an HTTP error while provide http status
inspect()
inspect() implementation, which just returns the JSON output.
onerror(err?: any)
throw(...args: any[]): never
Throw an error with msg
and optional status
defaulting to 500. Note that these are user-level
errors, and the message may be exposed to the client.
this.throw(403) this.throw(400, 'name required') this.throw('something exploded') this.throw(new Error('invalid')) this.throw(400, new Error('invalid'))
Note: status
should only be passed as the first parameter.
toJSON()