UNPKG

flipper-common

Version:

Server & UI shared Flipper utilities

71 lines 2.49 kB
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ import { ClientErrorType } from '../server-types'; export declare function isAuthError(err: any): err is UserNotSignedInError | UserUnauthorizedError; export declare function isConnectivityOrAuthError(err: any): err is ConnectivityError | UserNotSignedInError | UserUnauthorizedError | X2PAgentdError; export declare class SystemError extends Error { name: string; readonly context?: unknown; constructor(msg: string, ...args: unknown[]); } export declare class UserError extends Error { name: string; readonly context?: unknown; constructor(msg: string, ...args: unknown[]); } export declare class UnableToExtractClientQueryError extends Error { constructor(msg: string); name: 'UnableToExtractClientQueryError'; } export declare class CancelledPromiseError extends Error { constructor(msg: string); name: 'CancelledPromiseError'; } export declare class ConnectivityError extends Error { constructor(msg: string); name: 'ConnectivityError'; } export declare class InternGraphServerError extends Error { body: any; constructor(msg: string, body: any); name: 'InternGraphServerError'; } export declare class UserUnauthorizedError extends Error { constructor(msg?: string); name: 'UserUnauthorizedError'; } export declare class X2PAgentdError extends Error { constructor(msg: string); name: 'X2PAgentdError'; } export declare class UserNotSignedInError extends Error { constructor(msg?: string); name: 'UserNotSignedInError'; } export declare class NoLongerConnectedToClientError extends Error { constructor(msg?: string); name: 'NoLongerConnectedToClientError'; } export declare class FlipperServerDisconnectedError extends Error { readonly reason: 'ws-close'; constructor(reason: 'ws-close'); } export declare class FlipperServerTimeoutError extends Error { constructor(msg: string); } declare global { interface Error { interaction?: unknown; } } export declare function isError(obj: any): obj is Error; export declare function getErrorFromErrorLike(e: any): Error | undefined; export declare function getStringFromErrorLike(e: any): string; export declare const deserializeRemoteError: (serializedError: ClientErrorType) => Error; //# sourceMappingURL=errors.d.ts.map