@thalorlabs/errors
Version:
Enhanced exception handling system for TypeScript applications with comprehensive error classes and debugging capabilities
30 lines (29 loc) • 894 B
TypeScript
import CustomError from './CustomError';
/**
* Error for third-party service failures with service context.
*
* Used when external service calls fail with service-specific error information.
* Provides structured third-party service error context with HTTP 502 status by default.
*
* @example
* throw new ThirdPartyServiceError(
* 'Payment service unavailable',
* 'Stripe',
* originalError,
* 'req-123',
* { statusCode: 503, retryAfter: 30 }
* );
*
* throw new ThirdPartyServiceError(
* 'Email service failed',
* 'SendGrid',
* undefined,
* 'req-456'
* );
*/
export declare class ThirdPartyServiceError extends CustomError {
serviceName?: string;
originalError?: Error;
constructor(message?: string, serviceName?: string, originalError?: Error, requestId?: string, context?: Record<string, any>);
getErrorResponse(): Record<string, any>;
}