@opra/common
Version:
Opra common package
27 lines (26 loc) • 963 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotFoundError = void 0;
const opra_http_error_js_1 = require("../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.
*/
class NotFoundError extends opra_http_error_js_1.OpraHttpError {
constructor() {
super(...arguments);
this.status = 404;
}
init(issue) {
super.init({
message: 'Not found',
code: 'NOT_FOUND',
...issue,
});
}
}
exports.NotFoundError = NotFoundError;