Skip to main content
Dotset CLI API Documentation / index / RetryResult

Interface: RetryResult<T>

Defined in: src/shield/errors/index.ts:566 Error Handling and Recovery Module Comprehensive error handling with retry logic and circuit breakers.

Example

import {
  withRetry,
  withTimeout,
  CircuitBreaker,
  isRetryableError,
} from '@dotsetlabs/cli';

// Retry with exponential backoff
const result = await withRetry(
  () => fetchSecrets(),
  { maxAttempts: 3, baseDelayMs: 1000, backoffMultiplier: 2 }
);

// Add timeout to operation
const secrets = await withTimeout(fetchSecrets(), 5000);

// Use circuit breaker for external services
const breaker = new CircuitBreaker('aws-sm', {
  failureThreshold: 5,
  resetTimeoutMs: 30000,
});

const secret = await breaker.execute(() => getFromAWS(key));

Type Parameters

T

T

Properties

attempts

attempts: number;
Defined in: src/shield/errors/index.ts:570

error?

optional error: ShieldError;
Defined in: src/shield/errors/index.ts:569

result?

optional result: T;
Defined in: src/shield/errors/index.ts:568

success

success: boolean;
Defined in: src/shield/errors/index.ts:567

totalTimeMs

totalTimeMs: number;
Defined in: src/shield/errors/index.ts:571