UNPKG

@embrace-io/react-native

Version:
28 lines (27 loc) 1.12 kB
export interface SDKErrorLoggingConfig { /** * Enable/disable internal SDK error logging. */ enabled: boolean; /** * Log SDK errors to the console. * Recommend to set to true in development environments for easier debugging. * Recommend to set to false in production environments to avoid duplicate logging. */ allowLogToConsole: boolean; /** * Optional custom handler for SDK errors. * Use this to integrate with your own error tracking system. * @example * ```ts * customHandler: (method, error) => { * MyErrorTrackingService.logError(`SDK error in ${method}`, error); * } * ``` */ customHandler?: (methodName: string, error: Error) => void; } export declare const handleSDKError: (methodName: string, error: unknown) => void; export declare const safePromise: <T>(promise: Promise<T>, methodName: string, fallback: T) => Promise<T>; export declare const configureSDKErrorLogging: (config: Partial<SDKErrorLoggingConfig>) => void; export declare const getSDKErrorLoggingConfig: () => Readonly<SDKErrorLoggingConfig>;