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

Handle errors and warnings in a consistent way #80

Open
lognaturel opened this issue Apr 15, 2024 · 0 comments
Open

Handle errors and warnings in a consistent way #80

lognaturel opened this issue Apr 15, 2024 · 0 comments

Comments

@lognaturel
Copy link
Member

lognaturel commented Apr 15, 2024

This issue is to track the broader approach to error handling.

User stories

As an end user filling out a web form
I want to see clear error messages that are styled consistently with the host app
So that I can understand what happened when something goes wrong

As a host application developer
I want the option to let web forms show their own error messages in a consistent way
So that I don't have to think about error states at all

As a host application developer
I want the option to display error messages in a way that is appropriate for my host app
So that I can create a custom user experience

Types of errors

  • Initialization errors (e.g. invalid XML form def)
    • Could always result in a rejected promise
  • Bugs we haven't caught yet
  • Form design issues
    • Missing secondary instance or missing subpath into it
    • Typo in expression, especially things like second part of if which isn't run at initialization time (but there is/could be static analysis)
    • Unknown functions (maybe we warn?)
    • Divide by 0, other inevitable runtime issues

Types of warnings

Notes

  • Use error condition return values rather than throwing
    • So we can specify what errors are possible
    • For saner control flow (we'll have to make sure to use catch-alls to handle unknown unknowns)
  • Create a clear interface for the UI to consume error messages, first for our own internal use, and eventually to let clients consume them in a custom way
  • Aim for a dependency-injection type of pattern for the client
@lognaturel lognaturel changed the title Handle errors in a consistent way Handle errors and warnings in a consistent way Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant