Skip to content

v1.3.3

Compare
Choose a tag to compare
@predetermined predetermined released this 30 Dec 15:36
· 3 commits to main since this release
85f5f39

Requires at least Deno version 1.13

Updates

  • The fallback handler now receives a second argument, errorType, so it's easier to determine why a route wasn't matched. You can find an example here.
export enum ErrorType {
  NotFound,
  SchemaMismatch,
  ErrorThrownInResponseHandler,
}
  • If an error occurs in a request handler, the error is now being returned as the route's content by default (can be changed with a custom fallback handler), instead of causing the application to break.
app.get("/error", (req) => {
  throw new Error("test");
});
// The route now returns "Error: test"
  • There is now support for more content return types (this also enables streaming).
type ResponseContent =
  | Uint8Array
  | Blob
  | BufferSource
  | FormData
  | URLSearchParams
  | ReadableStream<Uint8Array>
  | string;