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

ErrorMessage should provide better default behavior #3555

Open
saba-mo opened this issue Dec 16, 2023 · 1 comment
Open

ErrorMessage should provide better default behavior #3555

saba-mo opened this issue Dec 16, 2023 · 1 comment

Comments

@saba-mo
Copy link
Contributor

saba-mo commented Dec 16, 2023

Several issues with the default behavior of errorMessage:

  1. The component offers the actionFn and detailsFn props that, when provided, will render styled Retry and Details buttons. It would be an improvement if you could set a prop to true that would not only get you the styled button but also a default function for the button's onClick. Right now you have to write the following boilerplate to get commonly used functions.
actionFn: () => model.refreshAsync()
detailsFn: () => XH.exceptionHandler.showExceptionDetails(error) 
  1. The most obvious binding choice -- errorMessage({error: model.lastLoadException}) often doesn't look good:

e.g. Model throws in doLoadAsync() with e.g. HTTP500, resulting error comes back from fetchService with empty string message, mildly-useful name. Our errorMessage component displays small empty red box - looks silly.

Should be able to better source meaningful content from exception + fallback to generic error message string if none found.

@lbwexler
Copy link
Member

Anselm also pointed out related issues here in this ticket #3441

Have closed in favor of this ticket

@amcclain amcclain changed the title ErrorMessage should provide better default behavior ErrorMessage should provide better default behavior Jan 26, 2024
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

No branches or pull requests

2 participants