multibridge
Version:
A multi-database connection framework with centralized configuration
56 lines (55 loc) • 1.84 kB
JavaScript
;
/**
* Custom error classes for MultiBridge
* Provides consistent error handling throughout the codebase
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimeoutError = exports.QueryError = exports.ValidationError = exports.ConfigurationError = exports.ConnectionError = exports.TenantContextError = exports.MultiBridgeError = void 0;
class MultiBridgeError extends Error {
code;
context;
constructor(message, code, context) {
super(message);
this.code = code;
this.context = context;
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
exports.MultiBridgeError = MultiBridgeError;
class TenantContextError extends MultiBridgeError {
constructor(message, context) {
super(message, "TENANT_CONTEXT_ERROR", context);
}
}
exports.TenantContextError = TenantContextError;
class ConnectionError extends MultiBridgeError {
constructor(message, context) {
super(message, "CONNECTION_ERROR", context);
}
}
exports.ConnectionError = ConnectionError;
class ConfigurationError extends MultiBridgeError {
constructor(message, context) {
super(message, "CONFIGURATION_ERROR", context);
}
}
exports.ConfigurationError = ConfigurationError;
class ValidationError extends MultiBridgeError {
constructor(message, context) {
super(message, "VALIDATION_ERROR", context);
}
}
exports.ValidationError = ValidationError;
class QueryError extends MultiBridgeError {
constructor(message, context) {
super(message, "QUERY_ERROR", context);
}
}
exports.QueryError = QueryError;
class TimeoutError extends MultiBridgeError {
constructor(message, context) {
super(message, "TIMEOUT_ERROR", context);
}
}
exports.TimeoutError = TimeoutError;