refactor: add error boundaries, improve error handling - #73
Open
robsimmons wants to merge 7 commits into
Open
Conversation
robsimmons
marked this pull request as draft
August 6, 2026 22:00
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
from
August 6, 2026 23:11
c8b7c45 to
8eac450
Compare
robsimmons
commented
Aug 6, 2026
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
from
August 6, 2026 23:38
de2f484 to
4bb0097
Compare
robsimmons
marked this pull request as ready for review
August 6, 2026 23:39
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
from
August 7, 2026 01:14
b75a82f to
361d9c5
Compare
apply pattern in a few more cases more agent commentary
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
4 times, most recently
from
August 7, 2026 19:13
0bbbbe0 to
2a24b90
Compare
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
from
August 7, 2026 19:17
2a24b90 to
0ad14d9
Compare
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
2 times, most recently
from
August 7, 2026 21:14
e01d06a to
fb225ae
Compare
robsimmons
commented
Aug 7, 2026
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
from
August 7, 2026 21:18
fb225ae to
1c33022
Compare
robsimmons
force-pushed
the
push-xmuqwrsvvrur
branch
from
August 7, 2026 21:44
1c33022 to
55acb29
Compare
Vtec234
requested changes
Aug 8, 2026
Vtec234
left a comment
Member
There was a problem hiding this comment.
Thank you, this seems like an improvement.
Co-authored-by: Wojciech Nawrocki <13901751+Vtec234@users.noreply.github.com>
Co-authored-by: Wojciech Nawrocki <13901751+Vtec234@users.noreply.github.com>
Co-authored-by: Wojciech Nawrocki <13901751+Vtec234@users.noreply.github.com>
Vtec234
approved these changes
Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds normal Next.js error boundaries for handling exceptional, "talk to your administrator" control flows to the application, simplifies some of the logic around encountering those cases (they'll just throw to the error boundary), and handles many cases where exceptions were being ignored.
Distinguishing normal errors and unexpected exceptions
When I was exploring adding new linting rules I observed a (pervasive, common, classic, first line in Next.js docs on error handling) conflation between two different types of server-side errors:
Using ActionResponse for the latter use case, and the combination of SWR and serverAction access patterns, meant that there were places where e.g. an Error was getting
as-cast tostringand then getting placed in the React document like a string, resulting in an error.Surfacing errors
This PR addresses quite a number of places where uncaught exceptions are thrown in handlers, and these get ignored completely, or at most with a comment in the console.
useThrowingSWRanduseThrowToBoundaryare introduced as patterns for taking a computation outside of the render phase and catching an error for the purpose of re-throwing it to an error boundary.Additional
errorsearchParams being authoritatively communicated to users