UNPKG

fcr-core

Version:

Core APIs for building online scenes

49 lines (48 loc) 1.61 kB
export declare class FcrError extends Error { private _code; private _message; private _origin?; get origin(): Error | undefined; get code(): string; get message(): string; constructor(_code: string, _message: string, _origin?: Error | undefined); } export declare enum FcrErrorCodeType { CLIENT = 6, SERVER = 7 } export declare enum FcrErrorModuleCode { ENGINE = 10, ENGINE_PEER_SESSION = 11, ROOM = 20, ROOM_USER = 21, ROOM_STREAM = 22, ROOM_GROUP = 23, ROOM_CHATROOM = 24, ROOM_SESSION = 25, ROOM_PRIVILEGE = 26, ROOM_WHITEBOARD = 27, ROOM_CONNECTOR = 28, ROOM_INTERPRETER = 29, MEDIA_CONTROL = 30, MEDIA_CONTROL_CAMERA = 31, MEDIA_CONTROL_MICROPHONE = 32, MEDIA_CONTROL_LOOPBACK = 33, MEDIA_CONTROL_SCREEN = 34, MONITOR = 40, ROOM_LIVE_STREAMING = 41 } export declare enum FcrErrorCode { UNDEFINED_ERROR = 1, INVALID_PARAMS = 10, JSON_PARSE_ERROR = 11, LOCAL_HTTP_REQUEST_FAILED = 12, NOT_LOGGED_IN = 13, NOT_JOINED_ROOM = 14, JOIN_CONFLICT = 15, EXPIRED = 15 } export declare const generateFcrCoreClientError: (module: FcrErrorModuleCode, code: number, message: string, origin: Error) => FcrError; export declare const generateFcrCoreServerError: (code: number, message: string, origin: Error) => FcrError; export declare const handleRequestError: <T extends () => Promise<any>>(action: T, errorModuleCode: FcrErrorModuleCode, errorMessage?: string) => Promise<Awaited<ReturnType<T>>>; export declare const RTE_ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM: string[];