Comment out bugsnag code (#16)

Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)

Reviewed-on: cerc-io/snowballtools-base#16
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
This commit is contained in:
Nabarun 2024-10-25 12:40:34 +00:00 committed by nabarun
parent 2a35ec1cd5
commit b449c299dc

View File

@ -1,34 +1,36 @@
import React from 'react'; // import React from 'react';
import Bugsnag from '@bugsnag/js'; // import Bugsnag from '@bugsnag/js';
import BugsnagPluginReact from '@bugsnag/plugin-react'; // import BugsnagPluginReact from '@bugsnag/plugin-react';
import BugsnagPerformance from '@bugsnag/browser-performance'; // 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) { // if (VITE_BUGSNAG_API_KEY) {
Bugsnag.start({ // Bugsnag.start({
apiKey: VITE_BUGSNAG_API_KEY, // apiKey: VITE_BUGSNAG_API_KEY,
plugins: [new BugsnagPluginReact()], // plugins: [new BugsnagPluginReact()],
}); // });
BugsnagPerformance.start({ apiKey: VITE_BUGSNAG_API_KEY }); // 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 // export const LogErrorBoundary = VITE_BUGSNAG_API_KEY
? Bugsnag.getPlugin('react')!.createErrorBoundary(React) // ? Bugsnag.getPlugin('react')!.createErrorBoundary(React)
: ({ children }: any) => children; // : ({ children }: any) => children;
export function logError(error: Error) { // export function logError(error: Error) {
let errors: any[] = [error]; // let errors: any[] = [error];
let safety = 0; // let safety = 0;
while (errors[errors.length - 1].cause && safety < 10) { // while (errors[errors.length - 1].cause && safety < 10) {
errors.push('::caused by::', errors[errors.length - 1].cause); // errors.push('::caused by::', errors[errors.length - 1].cause);
safety += 1; // safety += 1;
} // }
console.error(...errors); // console.error(...errors);
if (VITE_BUGSNAG_API_KEY) { // if (VITE_BUGSNAG_API_KEY) {
Bugsnag.notify(error); // Bugsnag.notify(error);
} // }
} // }
export const LogErrorBoundary = ({ children }: any) => children;