Spaces:
Configuration error
Configuration error
File size: 1,166 Bytes
5641073 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalError = exports.NotFoundError = exports.MethodNotAllowedError = exports.KVError = void 0;
class KVError extends Error {
constructor(message, status = 500) {
super(message);
// see: typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html
Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain
this.name = KVError.name; // stack traces display correctly now
this.status = status;
}
}
exports.KVError = KVError;
class MethodNotAllowedError extends KVError {
constructor(message = `Not a valid request method`, status = 405) {
super(message, status);
}
}
exports.MethodNotAllowedError = MethodNotAllowedError;
class NotFoundError extends KVError {
constructor(message = `Not Found`, status = 404) {
super(message, status);
}
}
exports.NotFoundError = NotFoundError;
class InternalError extends KVError {
constructor(message = `Internal Error in KV Asset Handler`, status = 500) {
super(message, status);
}
}
exports.InternalError = InternalError;
|