NuxtN
Nuxt10mo ago
21 replies
Mole

useAsyncData - opt out of reactive error handling

I haven't done much research yet on this topic. However, I am hoping you have the experience and can help :)

Motivation
My job is making sure business brings money. Component-level error boundaries are cool, no question about it. Business and practical UX wise not so much. Details do not matter, what matters is that they are also more costly to design and develop, compared to the old school full page error.

Objective
I would love my useAsyncData to old-school throw the error instead of requiring the developer to explicitly handle reactive error property. Something akin to { throwErrors: true }, which opts-out of reactive error handling, throws the error and allows me to centrally handle it.

Yapping
When I search for useAsyncData in the project. Out of hundreds occurrences, most do not handle error at all. Some do, check the value and showError it instantly, ignoring it is reactive. Only few actually uses it correctly.

Is the code bad because it omits error handling? Certainly.
Should default behavior encourage silent error swallowing. Debatable.

Question
How are you handling errors which do not justify custom logic
e809b899-c5d5-4cfb-83cf-ce02a80b566a.png
Was this page helpful?