Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/reno/reno/mod.ts>MissingRouteError

A thin, testable routing library designed to sit on top of Deno's standard HTTP module
Go to Latest
class MissingRouteError
extends Error
import { MissingRouteError } from "https://deno.land/x/reno@v2.0.75/reno/mod.ts";

An error that's thrown by Reno when a route for a particular request's path cannot be found in the router's route map. You won't need to instantiate and throw this directly, but it's exported to support instanceof checks in error handling logic:

const notFound = (e: MissingRouteError) => createErrorResponse(404, e);
const serverError = (e: Error) => createErrorResponse(500, e);

const mapToErrorResponse = (e: Error) =>
  e instanceof MissingRouteError ? notFound(e) : serverError(e);

Constructors

new
MissingRouteError(pathname: string)