Skip to content
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

PXP-635: [CLI] Terminate the TUI when there is a panic on TUI #174

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

mfauzaan
Copy link
Member

@mfauzaan mfauzaan commented Nov 21, 2023

Summary

Currently, when a panic occurs in the Wukong CLI, the panic message is displayed on the TUI screen and breaks the TUI rendering and makes it TUI unusable.

To address this issue, a panic hook has been implemented to capture TUI errors and ensure a safe exit. Additionally, network panics needs to be handled on a case-by-case basis, providing relevant error messages to users in the corresponding panel.

Ticket: https://mindvalley.atlassian.net/browse/PXP-635

What's Changed

  • Add panic hook

@mfauzaan mfauzaan self-assigned this Nov 21, 2023
@mfauzaan mfauzaan added the bugfix Bug fix label Nov 21, 2023
@mfauzaan mfauzaan marked this pull request as ready for review November 21, 2023 05:54
@onimsha onimsha requested a review from jk-gan November 22, 2023 02:40
Some(s) => *s,
None => match panic_info.payload().downcast_ref::<String>() {
Some(s) => &s[..],
None => "Box<Any>",
Copy link
Contributor

@jk-gan jk-gan Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does Box<Any> mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally taken from here

As my understanding was that its a placeholder to match the string return types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it

@sauron-droid
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jk-gan, mfauzaan

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@onimsha onimsha merged commit b667c99 into main Nov 23, 2023
5 checks passed
@sauron-droid sauron-droid deleted the feat/panic-handler branch November 23, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants