import * as mod from "https://dotland.deno.dev/x/alosaur@v0.35.0/src/http-error/HttpError.ts"; ClassescHttpErrorUsed to throw HTTP errors. Just do throw new HttpError(code, message) in your controller action and default error handler will catch it and give in your response given code and message .