UNPKG

@onamfc/video-transcoder

Version:

Backend-agnostic video recording and transcoding module with AWS integration

31 lines 1.36 kB
import type { ErrorEvent } from '../types'; export declare class VideoRecorderError extends Error { readonly type: ErrorEvent['type']; readonly code?: string; readonly retryable: boolean; readonly trackingId?: string; constructor(message: string, type: ErrorEvent['type'], options?: { code?: string; retryable?: boolean; trackingId?: string; cause?: Error; }); toErrorEvent(): ErrorEvent; } export declare class ErrorHandler { private static errorCounts; private static maxRetries; static handleRecordingError(error: Error, trackingId?: string): VideoRecorderError; static handleUploadError(error: Error, trackingId?: string): VideoRecorderError; static handleProcessingError(error: Error, trackingId?: string): VideoRecorderError; static shouldRetry(error: VideoRecorderError): boolean; static getRetryDelay(attemptNumber: number): number; static clearRetryCount(errorType: string, code?: string): void; static logError(error: VideoRecorderError, context?: Record<string, unknown>): void; } export declare const createErrorHandler: (trackingId?: string) => { recording: (error: Error) => VideoRecorderError; upload: (error: Error) => VideoRecorderError; processing: (error: Error) => VideoRecorderError; }; //# sourceMappingURL=errorHandler.d.ts.map