-
Notifications
You must be signed in to change notification settings - Fork 20
Start up error handling #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
…rror) and abort login process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses startup error handling by showing error details, logging out the wallet, and navigating to the login screen when an initialization error occurs.
- Introduces an optional onError callback in loginAndUpdateState to allow custom error handling
- Integrates a new switchWallet command across the frontend and backend
- Updates error handling logic and error kind definitions to support database migration recoverability
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/state.ts | Updated loginAndUpdateState to accept an optional onError callback |
src/pages/Login.tsx | Modified login flow to use the updated loginAndUpdateState |
src/hooks/useInitialization.ts | Added logic to handle database migration errors by logging out and updating state |
src/contexts/ErrorContext.tsx | Updated styling from break-all to break-words for error messages |
src/bindings.ts and related files | Added and integrated switchWallet command and updated error kind definitions |
Other Rust command files | Added switch_wallet command support across Tauri, CLI, and RPC implementations |
Comments suppressed due to low confidence (1)
src/state.ts:98
- After invoking the onError callback, the function rethrows the error; ensure that all callers of loginAndUpdateState properly handle the rethrown error to prevent unintended disruptions.
onError(error as CustomError);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #140
If there is an error during initialization it now shows the error, logs out of the wallet and navigates to the login screen, which will allow the user to delete a corrupt wallet db and resync.