{"library":"ono-http","title":"ono-http","description":"ono-http (v0.2.0) extends the ono library to create HTTP-specific error objects with status codes and standard HTTP error messages. It allows throwing errors with a status code (e.g., 404) and an optional custom message using printf-style formatting. The library is lightweight, wraps inner errors, and integrates with ono's error formatting. Current version is early (0.x) and not widely adopted; no clear release cadence. Key differentiator: combines ono's structured error throwing with HTTP status codes for server-side applications.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install ono-http"],"cli":null},"imports":["import { httpError } from 'ono-http'","import { createErrorClass } from 'ono-http'","import { OnoHttpError } from 'ono-http'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { httpError } from 'ono-http';\n\n// Throw a 404 Not Found error with a custom message\nconst err = httpError(404, 'Resource %s not found', 'user/123');\nthrow err;\n\n// Wrap an existing error with HTTP status\nconst original = new Error('Database connection failed');\nconst wrapped = httpError(500, original);\nthrow wrapped;","lang":"typescript","description":"Shows how to create and throw HTTP errors with status codes and format messages, and how to wrap existing errors.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}