The HTTP status code for the error.
Optional
message: stringAn optional custom message for the error.
Optional response initialization options.
A Response object representing the error.
Example usage:
import { start, router, error } from "@pulsar-http/core";
const routes = [
router.get("/not-found", async () => error(404, "The page you requested was not found.")),
];
start({ routes });
In this example, the response will have a 404 status code and the message "The page you requested was not found.".
Creates an error response with the specified status code and optional message.