v1.3.3
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;