Skip to content

Fix #4538: 删除实例失败时弹出对话框 - #4540

Merged
Glavo merged 3 commits into
HMCL-dev:mainfrom
Glavo:fix-4538
Nov 8, 2025
Merged

Fix #4538: 删除实例失败时弹出对话框#4540
Glavo merged 3 commits into
HMCL-dev:mainfrom
Glavo:fix-4538

Conversation

@Glavo

@Glavo Glavo commented Sep 23, 2025

Copy link
Copy Markdown
Member

No description provided.

Comment thread HMCL/src/main/resources/assets/lang/I18N_zh.properties Outdated
Comment thread HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties Outdated
@Glavo
Glavo requested a review from Copilot November 8, 2025 13:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 removeVersionFromDisk is not checked here. Similar to the fix in the deleteVersion method, 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.

@Glavo
Glavo merged commit 733b2c9 into HMCL-dev:main Nov 8, 2025
2 checks passed
@Glavo
Glavo deleted the fix-4538 branch November 8, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants