class ErrorResponse
extends Response
Re-export
import { ErrorResponse } from "https://deno.land/x/keywork@v6.2.1/http/mod.ts";
An error response sent to a client when a request is deemed to be invalid in some way.
Constructors
Given an error-like object, attempt to respond with a KeyworkResourceError
.
try {
result = await fetchFoobarResource()
} catch (error) {
// Log the error internally...
logger.error(error)
// And then respond with a public reason...
return new ErrorResponse(error, 'An error occured while fetching foobar.')
}