-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tauri v1 -> v2 with no compiler complaints
- Loading branch information
Showing
52 changed files
with
16,797 additions
and
1,543 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,45 @@ | ||
import { showError } from '$lib/notifications/toasts'; | ||
import { captureException } from '@sentry/sveltekit'; | ||
import { error as logErrorToFile } from 'tauri-plugin-log-api'; | ||
import type { HandleClientError } from '@sveltejs/kit'; | ||
// import { showError } from '$lib/notifications/toasts'; | ||
// import { captureException } from '@sentry/sveltekit'; | ||
// import { error as logErrorToFile } from 'tauri-plugin-log-api'; | ||
// import type { HandleClientError } from '@sveltejs/kit'; | ||
|
||
// SvelteKit error handler. | ||
export function handleError({ | ||
error, | ||
status | ||
}: { | ||
error: unknown; | ||
status: number; | ||
}): ReturnType<HandleClientError> { | ||
if (status !== 404) { | ||
logError(error); | ||
} | ||
return { | ||
message: String(error) | ||
}; | ||
} | ||
// // SvelteKit error handler. | ||
// export function handleError({ | ||
// error, | ||
// status | ||
// }: { | ||
// error: unknown; | ||
// status: number; | ||
// }): ReturnType<HandleClientError> { | ||
// if (status !== 404) { | ||
// logError(error); | ||
// } | ||
// return { | ||
// message: String(error) | ||
// }; | ||
// } | ||
|
||
// Handler for unhandled errors inside promises. | ||
window.onunhandledrejection = (e: PromiseRejectionEvent) => { | ||
logError(e.reason); | ||
// logError(e.reason); | ||
console.trace(e); | ||
}; | ||
|
||
function logError(error: unknown) { | ||
let message = error instanceof Error ? error.message : String(error); | ||
const stack = error instanceof Error ? error.stack : undefined; | ||
// function logError(error: unknown) { | ||
// let message = error instanceof Error ? error.message : String(error); | ||
// const stack = error instanceof Error ? error.stack : undefined; | ||
|
||
const id = captureException(message, { | ||
mechanism: { | ||
type: 'sveltekit', | ||
handled: false | ||
} | ||
}); | ||
message = `${id}: ${message}\n`; | ||
if (stack) message = `${message}\n${stack}\n`; | ||
// const id = captureException(message, { | ||
// mechanism: { | ||
// type: 'sveltekit', | ||
// handled: false | ||
// } | ||
// }); | ||
// message = `${id}: ${message}\n`; | ||
// if (stack) message = `${message}\n${stack}\n`; | ||
|
||
logErrorToFile(message); | ||
console.error(message); | ||
showError('Something went wrong', message); | ||
return id; | ||
} | ||
// logErrorToFile(message); | ||
// console.error(message); | ||
// showError('Something went wrong', message); | ||
// return id; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import { invoke as invokeIpc, listen as listenIpc } from './ipc'; | ||
import { getVersion } from '@tauri-apps/api/app'; | ||
import { checkUpdate, onUpdaterEvent } from '@tauri-apps/api/updater'; | ||
import { check } from '@tauri-apps/plugin-updater'; | ||
|
||
export class Tauri { | ||
invoke = invokeIpc; | ||
listen = listenIpc; | ||
checkUpdate = checkUpdate; | ||
onUpdaterEvent = onUpdaterEvent; | ||
checkUpdate = check; | ||
currentVersion = getVersion; | ||
} |
Oops, something went wrong.