h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Enable "production-level" on-screen logging, versus showing stack traces (aka "error boundary") #2188

Closed bandaider closed 7 months ago

bandaider commented 7 months ago

Is your feature request related to a problem?

There appears to be no way to display a user-friendly error message when one's application fails due to developer or runtime error.

For example, in React, this is considered an "error boundary". When an unhandled exception occurs in your application, it is captured in the error boundary, where the developer can provide a helpful message to the user.

Currently, there appears no way to specify or add such a boundary, at least out of the box.

Describe the solution you'd like

When the application is run in a "production" mode, perhaps through a new flag, the developer can define or set a boundary area or qargs that is captured whereby the developer can render a card that hides the underlying exception but allows the developer to specify a user-friendly error message.

Describe alternatives you've considered

None at this time.

Additional context

None at this time.

mturoci commented 7 months ago

Hi @bandaider. Did you try using Python's try catch? Wave only shows stacktrace for unhandled errors. However, app developers are free to handle and display the errors in any way they want.

Here is one possible implementation that one of our teams uses in an app called LLM Studio.