2025-10-04 15:40:41 +00:00
|
|
|
import { BaseError } from "./base-error";
|
|
|
|
|
|
|
|
|
|
/** Errores de infraestructura: DB, red, serialización, proveedores externos */
|
|
|
|
|
export class InfrastructureError extends BaseError<"infrastructure"> {
|
|
|
|
|
public readonly layer = "infrastructure" as const;
|
2025-10-04 16:29:14 +00:00
|
|
|
constructor(
|
|
|
|
|
message: string,
|
|
|
|
|
code = "INFRASTRUCTURE_ERROR",
|
|
|
|
|
options?: ErrorOptions & { metadata?: Record<string, unknown> }
|
|
|
|
|
) {
|
2025-10-04 15:40:41 +00:00
|
|
|
super("InfrastructureError", message, code, options);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-04 16:29:14 +00:00
|
|
|
|
|
|
|
|
export const isInfrastructureError = (e: unknown): e is InfrastructureError =>
|
|
|
|
|
e instanceof InfrastructureError;
|