Comment out bugsnag
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 4m55s
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 4m55s
This commit is contained in:
parent
2a35ec1cd5
commit
34867c0995
@ -1,34 +1,36 @@
|
||||
import React from 'react';
|
||||
import Bugsnag from '@bugsnag/js';
|
||||
import BugsnagPluginReact from '@bugsnag/plugin-react';
|
||||
import BugsnagPerformance from '@bugsnag/browser-performance';
|
||||
// import React from 'react';
|
||||
// import Bugsnag from '@bugsnag/js';
|
||||
// import BugsnagPluginReact from '@bugsnag/plugin-react';
|
||||
// import BugsnagPerformance from '@bugsnag/browser-performance';
|
||||
|
||||
import { VITE_BUGSNAG_API_KEY } from './constants';
|
||||
// import { VITE_BUGSNAG_API_KEY } from './constants';
|
||||
|
||||
if (VITE_BUGSNAG_API_KEY) {
|
||||
Bugsnag.start({
|
||||
apiKey: VITE_BUGSNAG_API_KEY,
|
||||
plugins: [new BugsnagPluginReact()],
|
||||
});
|
||||
BugsnagPerformance.start({ apiKey: VITE_BUGSNAG_API_KEY });
|
||||
}
|
||||
// if (VITE_BUGSNAG_API_KEY) {
|
||||
// Bugsnag.start({
|
||||
// apiKey: VITE_BUGSNAG_API_KEY,
|
||||
// plugins: [new BugsnagPluginReact()],
|
||||
// });
|
||||
// BugsnagPerformance.start({ apiKey: VITE_BUGSNAG_API_KEY });
|
||||
// }
|
||||
|
||||
export const errorLoggingEnabled = !!VITE_BUGSNAG_API_KEY;
|
||||
// export const errorLoggingEnabled = !!VITE_BUGSNAG_API_KEY;
|
||||
|
||||
export const LogErrorBoundary = VITE_BUGSNAG_API_KEY
|
||||
? Bugsnag.getPlugin('react')!.createErrorBoundary(React)
|
||||
: ({ children }: any) => children;
|
||||
// export const LogErrorBoundary = VITE_BUGSNAG_API_KEY
|
||||
// ? Bugsnag.getPlugin('react')!.createErrorBoundary(React)
|
||||
// : ({ children }: any) => children;
|
||||
|
||||
export function logError(error: Error) {
|
||||
let errors: any[] = [error];
|
||||
let safety = 0;
|
||||
while (errors[errors.length - 1].cause && safety < 10) {
|
||||
errors.push('::caused by::', errors[errors.length - 1].cause);
|
||||
safety += 1;
|
||||
}
|
||||
console.error(...errors);
|
||||
// export function logError(error: Error) {
|
||||
// let errors: any[] = [error];
|
||||
// let safety = 0;
|
||||
// while (errors[errors.length - 1].cause && safety < 10) {
|
||||
// errors.push('::caused by::', errors[errors.length - 1].cause);
|
||||
// safety += 1;
|
||||
// }
|
||||
// console.error(...errors);
|
||||
|
||||
if (VITE_BUGSNAG_API_KEY) {
|
||||
Bugsnag.notify(error);
|
||||
}
|
||||
}
|
||||
// if (VITE_BUGSNAG_API_KEY) {
|
||||
// Bugsnag.notify(error);
|
||||
// }
|
||||
// }
|
||||
|
||||
export const LogErrorBoundary = ({ children }: any) => children;
|
||||
|
Loading…
Reference in New Issue
Block a user