Add companion logging

Summary: Add top-level error logging to flipper-server. Use the top-level logging mechanism in flipper-companion.

Reviewed By: lblasa

Differential Revision: D36252218

fbshipit-source-id: 58d22b3b9bd51e597b5250478640f54d10277861
This commit is contained in:
Andrey Goncharov
2022-05-10 05:13:24 -07:00
committed by Facebook GitHub Bot
parent e218b79de2
commit 98dde53cda
4 changed files with 134 additions and 29 deletions

View File

@@ -41,6 +41,8 @@ export {
UserUnauthorizedError,
UserNotSignedInError,
NoLongerConnectedToClientError,
UserError,
SystemError,
isConnectivityOrAuthError,
isError,
isAuthError,

View File

@@ -30,6 +30,24 @@ export function isConnectivityOrAuthError(
);
}
export class SystemError extends Error {
name = 'SystemError';
readonly context?: unknown;
constructor(msg: string, ...args: unknown[]) {
super(msg);
this.context = args;
}
}
export class UserError extends Error {
name = 'UserError';
readonly context?: unknown;
constructor(msg: string, ...args: unknown[]) {
super(msg);
this.context = args;
}
}
export class UnableToExtractClientQueryError extends Error {
constructor(msg: string) {
super(msg);