-
Notifications
You must be signed in to change notification settings - Fork 0
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
Error reporting #26
Comments
I can think of two different scenarios:
If errors were always emitted from the element that generated the request then we could achieve both cases (a global event handler would listen for error events on any element that contains all fs elements, such as the app or the body).
|
I can think of two ways to make sure in memory usage of
I'm not a fan of option 2 so we'll go with 1. There are some situations where we are able to keep a single There are other situations, such as in mixins, where relying on an element being in the DOM at all times is a little more precarious. These cases can be handled by dynamically attaching it to the element's DOM before the request is executed and then removing it later if desired. |
Usage:
|
I could have those requests add themselves as children to the
Firing events on the element would change the event target which at best is inconsistent and at worst it could be problematic. Attaching the request as a child of the element could also create problems if the host element isn't aware that the request element exists (i.e. accidentally modify or remove the request). We might rely on developers to know the behavior of |
Turns out we can't actually delegate events. Currently the only way to receive a response is by attaching an event listener to the response events so delegating events to another element breaks that contract. Therefore the only option we have left is to see that the elements are added to the DOM when we want events to propagate. |
I just realized that we don't need another event just for HTTP errors. After making all request events bubble (propagate) we can now just listen for |
I have toast notifications appearing but the error messages are not particularly helpful. The API isn't very consistent about providing helpful error messages so the best I can do is |
When a 4xx or 5xx error is encountered we need to display the error to the client. An easy way to get an error is to change the gender.
The text was updated successfully, but these errors were encountered: