NotImplemented class represents an HTTP error response with status code 501. It is used to standardize "Not Implemented" error responses, typically when a requested feature or functionality has not been developed yet.ts
import { NotImplemented } from "@arkyn/server";
message (required): A descriptive message explaining why the feature is not implemented.cause (optional): Additional information about the error cause, which can be any serializable data.toResponse() - Converts the instance into a Response object with JSON body and Content-Type: application/json header.toJson() - Alternative method using Response.json() for generating the JSON error response.typescript
import { NotImplemented } from "@arkyn/server";// Basic usage - throw the errorthrow new NotImplemented("This feature is coming soon");// With cause informationthrow new NotImplemented("Payment method not supported yet", {requestedMethod: "crypto",availableMethods: ["credit_card", "pix"],});// Convert to Response objectconst error = new NotImplemented("Export to PDF is not available");return error.toResponse();// Using toJson alternativereturn error.toJson();
json
{"ok": false,"status": 501,"message": "This feature is coming soon"}
cause parameter is serialized to JSON and stored for debugging purposes but is not included in the response body sent to clients.