@ronnakamoto/inp-middleware
Version:
INP Protocol middleware for Express.js and Next.js applications - API-driven implementation with automatic metrics integration
54 lines • 1.79 kB
JavaScript
;
/**
* INP Middleware Error Classes
*
* Custom error classes for the INP middleware library
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.INPConfigError = exports.INPClientError = exports.INPDiscoveryError = exports.INPPaymentError = exports.INPValidationError = exports.INPError = void 0;
class INPError extends Error {
constructor(message, code = 'INP_ERROR', statusCode = 500, details) {
super(message);
this.name = 'INPError';
this.code = code;
this.statusCode = statusCode;
this.details = details;
}
}
exports.INPError = INPError;
class INPValidationError extends INPError {
constructor(message, details) {
super(message, 'VALIDATION_ERROR', 400, details);
this.name = 'INPValidationError';
}
}
exports.INPValidationError = INPValidationError;
class INPPaymentError extends INPError {
constructor(message, details) {
super(message, 'PAYMENT_ERROR', 402, details);
this.name = 'INPPaymentError';
}
}
exports.INPPaymentError = INPPaymentError;
class INPDiscoveryError extends INPError {
constructor(message, details) {
super(message, 'DISCOVERY_ERROR', 500, details);
this.name = 'INPDiscoveryError';
}
}
exports.INPDiscoveryError = INPDiscoveryError;
class INPClientError extends INPError {
constructor(message, details) {
super(message, 'CLIENT_ERROR', 500, details);
this.name = 'INPClientError';
}
}
exports.INPClientError = INPClientError;
class INPConfigError extends INPError {
constructor(message, details) {
super(message, 'CONFIG_ERROR', 500, details);
this.name = 'INPConfigError';
}
}
exports.INPConfigError = INPConfigError;
//# sourceMappingURL=index.js.map