fix: cleanup repo

This commit is contained in:
ndom91 2024-05-05 18:16:39 +02:00
parent 6244a67972
commit 2a7a84e655
No known key found for this signature in database
2 changed files with 10 additions and 9 deletions

5
app/.env.testing Normal file
View File

@ -0,0 +1,5 @@
PUBLIC_API_BASE_URL=https://test.app.gitbutler.com/
PUBLIC_POSTHOG_API_KEY=
PUBLIC_CHAIN_API=https://data-test.gitbutler.com/chain/
PUBLIC_SENTRY_ENVIRONMENT=
PUBLIC_TESTING=true

View File

@ -3,10 +3,8 @@ import { error as logErrorToFile } from 'tauri-plugin-log-api';
import type { NavigationEvent } from '@sveltejs/kit';
function myErrorHandler({ error, event }: { error: any; event: NavigationEvent }) {
if (typeof window.__TAURI_IPC__ === 'function') {
console.error(error.message + '\n' + error.stack);
logErrorToFile(error.toString());
}
console.error('An error occurred on the client side:', error, event);
}
@ -21,9 +19,7 @@ export const handleError = handleErrorWithSentry(myErrorHandler);
*/
const originalUnhandledHandler = window.onunhandledrejection;
window.onunhandledrejection = (event: PromiseRejectionEvent) => {
if (typeof window.__TAURI_IPC__ === 'function') {
logErrorToFile('Unhandled exception: ' + event?.reason + ' ' + event?.reason?.sourceURL);
console.log('Unhandled exception', event.reason);
originalUnhandledHandler?.bind(window)(event);
}
};