-
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
Consider changing the serverRequest function to throw #25
Comments
Turns out there are 27 references to this function. so it's a bit too much to change at once. I think I'll just introduce a second version of it that does throw when it encounters an error, and then we can gradually replace references to the current version with the new one. There are probably also some cases where the current |
Your current work on this will be included in 0.2.5, do you want me to keep this open or can this be closed? |
Improvements: * #14: Improved the UX of the add raider dialog * Made the title in the menu bar more stylish. Wow! Such style! * #22: Disabled the chart animation on the raid team page. * Added a WIP component to display on the raider page. Bug Fixes: * Fixed a bug where the raider overviews of characters with non-URI safe symbols in their name failed to generate. * Fixed a bug where lockout data failed to parse for characters that cleared dungeons / raids in previous expansions, but not the current one. * Fixed a bug where priests could fulfill the melee DPS role (sorry, you will have to be a paladin for that!) Internal: * Partial work on #25: Introduced a throwing version of serverRequest as well as error boundaries * Create a global context for getting user information in the frontend * #12: Upgraded frontend dependencies. * #13: Enable eslint and fix warnings in the frontend.
Currently the
serverRequest
function returns a union or either{ isOk: true; data: ... }
or{ isOk: false; status: ...; genericErrors: ...; fieldErrors: ... }
. I've noticed however that in many cases whenisOk == false
we often return an empty view, sometimes throw the error, and sometimes don't even check if there was an error. It seems this explicit approach to error handling is leading to bad practices, so I think we should changeserverRequest
to throw an error instead.The error can then be caught and handled by a generic error boundary component which we wrap around arbitrary points in the application.
(also, I wonder, does react do anything when errors are thrown inside onClick handlers, or are they ignored?)
The text was updated successfully, but these errors were encountered: