Fix #4538: 删除实例失败时弹出对话框 - #4540
Merged
Merged
Conversation
3gf8jv4dv
reviewed
Oct 3, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances error handling for version deletion operations by displaying an error dialog when deletion fails. The changes add internationalized error messages across three language files (English, Simplified Chinese, and Traditional Chinese) and updates the deleteVersion method to run the deletion asynchronously while checking for failures.
- Added error message translations for failed instance deletion
- Wrapped deletion operation in async Task with error handling
- Added error dialog display when deletion fails or throws an exception
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| I18N.properties | Added English error message for failed instance deletion |
| I18N_zh_CN.properties | Added Simplified Chinese error message for failed instance deletion |
| I18N_zh.properties | Added Traditional Chinese error message for failed instance deletion |
| Versions.java | Modified deleteVersion to handle failures asynchronously with error dialog |
Comments suppressed due to low confidence (1)
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/Versions.java:167
- The return value of
removeVersionFromDiskis not checked here. Similar to the fix in thedeleteVersionmethod, this call should verify the return value and handle failures appropriately. Consider showing an error dialog or logging if the cleanup operation fails.
profile.getRepository().removeVersionFromDisk(newVersionName);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
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.
No description provided.