komi-logger
Version:
High-performance, type-safe logging library for Bun with advanced TypeScript body intersection, modular strategy pattern, transform streams, and immutable API design.
32 lines (29 loc) • 651 B
JavaScript
// source/error/komiError.ts
import { randomUUID } from "crypto";
class KomiError extends Error {
cause;
_uuid = randomUUID();
_date = new Date;
_key;
_httpStatusCode;
constructor(komiErrorOptions) {
super(komiErrorOptions?.message);
super.name = "KomiError";
this.cause = komiErrorOptions?.cause;
this._key = komiErrorOptions?.key || "";
this._httpStatusCode = komiErrorOptions?.httpStatusCode || 500;
}
get uuid() {
return this._uuid;
}
get date() {
return this._date;
}
get key() {
return this._key;
}
get httpStatusCode() {
return this._httpStatusCode;
}
}
export { KomiError };