@busy-hour/blaze
Version:
<h1 align='center'>🔥 Blaze</h1> <div align='center'> An event driven framework for 🔥 Hono.js </div>
51 lines (50 loc) • 1.55 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var errors_exports = {};
__export(errors_exports, {
BlazeError: () => BlazeError
});
module.exports = __toCommonJS(errors_exports);
class BlazeError extends Error {
status;
errors;
constructor(err, status = 500) {
super(typeof err === "string" ? err : err.message);
if (typeof err === "string") {
this.status = status;
this.name = "BlazeError";
} else {
this.status = err.status;
this.errors = err.errors;
this.name = err.name ?? "BlazeError";
}
}
toJSON() {
return {
errors: this.errors,
message: this.message,
name: this.name,
status: this.status
};
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BlazeError
});