/** * GREEN Phase Tests for Error Handling Standardization * * Issue: postgres-4fto - Standardize error handling across packages * * This test file verifies the standardized error handling implementation * for the @dotdo/postgres-shared package. Tests for cross-package unification * (CDC, Iceberg, MongoDB) remain as it.fails() to document future work. * * ## Implemented Features: * * 1. **Unified Base Error Properties**: * - timestamp: Date - automatically captured when error is created * - suggestion: string - recovery guidance for errors * * 2. **Error Serialization**: * - toJSON() - standardized JSON format with timestamp * - fromJSON() - reconstruct errors from JSON * - toWorkerResponse() - safe format for Worker responses * * 3. **Error Context**: * - getRootCause() - traverse error chain to root * - wrapError() - supports context merging * - toMetrics() - observability format * * 4. **Error Recovery**: * - calculateRetryDelay() - exponential backoff with jitter * - getCircuitBreakerCategory() - categorize for circuit breaker * - aggregate() - batch error aggregation * * 5. **Type Guards**: * - isQueryError(), isConnectionError(), etc. * - narrowByErrorCode() - narrow by error code */ export {}; //# sourceMappingURL=error-handling-standardization.test.d.ts.map