Add info about interactions to error reports
Summary: When reporting errors we could add info about interactions which caused errors. Ability to connect errors and interactions could be quite helpful for analysing and debugging errors and where they are coming from. Reviewed By: passy, mweststrate Differential Revision: D28467575 fbshipit-source-id: bef69917a4d6c786d762a2f6eb75a47fd4e46b0f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
03a1add092
commit
853ee24c9b
16
desktop/app/src/__mocks__/uuid.tsx
Normal file
16
desktop/app/src/__mocks__/uuid.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
export function v4() {
|
||||
return '00000000-0000-0000-0000-000000000000';
|
||||
}
|
||||
|
||||
export function v1() {
|
||||
return '00000000-0000-0000-0000-000000000000';
|
||||
}
|
||||
@@ -15,14 +15,7 @@
|
||||
export function cleanStack(_stack: string, _loc?: string) {}
|
||||
import ScribeLogger from './ScribeLogger';
|
||||
|
||||
export type ObjectError =
|
||||
| Error
|
||||
| {
|
||||
message: string;
|
||||
stack?: string;
|
||||
};
|
||||
|
||||
export default class ErrorReporter {
|
||||
constructor(_scribeLogger: ScribeLogger) {}
|
||||
report(_err: ObjectError) {}
|
||||
report(_err: Error) {}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,20 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {InteractionReport} from 'flipper-plugin';
|
||||
|
||||
export class CancelledPromiseError extends Error {
|
||||
constructor(msg: string) {
|
||||
super(msg);
|
||||
this.name = 'CancelledPromiseError';
|
||||
}
|
||||
name: 'CancelledPromiseError';
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Error {
|
||||
interaction?: InteractionReport;
|
||||
}
|
||||
}
|
||||
|
||||
export function isError(obj: any): obj is Error {
|
||||
|
||||
Reference in New Issue
Block a user