UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

77 lines 1.68 kB
/** * @module Async */ /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group Errors */ export class AsyncError extends Error { constructor(message, cause) { super(message, { cause }); this.name = AsyncError.name; } } /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group Errors */ export class TimeoutAsyncError extends AsyncError { constructor(message, cause) { super(message, cause); this.name = TimeoutAsyncError.name; } } /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group Errors */ export class RetryAsyncError extends AsyncError { maxAttempts; errors = []; constructor(message, { errors, maxAttempts }) { super(message, errors); this.errors = errors; this.maxAttempts = maxAttempts; this.name = RetryAsyncError.name; } } /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group Errors */ export class HedgingAsyncError extends AsyncError { errors; constructor(message, errors) { super(message, errors); this.errors = errors; this.name = HedgingAsyncError.name; } } /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group Errors */ export class CapacityFullAsyncError extends AsyncError { constructor(message, cause) { super(message, cause); this.name = CapacityFullAsyncError.name; } } /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group Errors */ export const ASYNC_ERRORS = { Base: AsyncError, Timeout: TimeoutAsyncError, Retry: RetryAsyncError, Hedging: HedgingAsyncError, CapacityFull: CapacityFullAsyncError, }; //# sourceMappingURL=async.errors.js.map