UNPKG

@opra/common

Version:
23 lines (22 loc) 793 B
import { OpraHttpError } from '../opra-http-error.js'; /** * 404 Not Found * The server can not find the requested resource. In the browser, this means the URL is not recognized. * In an API, this can also mean that the endpoint is valid but the resource itself does not exist. * Servers may also send this response instead of 403 Forbidden to hide the existence of a resource * from an unauthorized client. This response code is probably the most well known due to its * frequent occurrence on the web. */ export class NotFoundError extends OpraHttpError { constructor() { super(...arguments); this.status = 404; } init(issue) { super.init({ message: 'Not found', code: 'NOT_FOUND', ...issue, }); } }