mykola
handling (http) errors with createResource
OK, so at the end it was a bug in the documentation, where they used
user.error()
instead of the user.error
for const user = createResource(...)
. Submitting a PR with a fix suggestion: https://github.com/solidjs/solid-docs-next/pull/8479 replies
handling (http) errors with createResource
Hey @Brendonovich , thank you for the quick reaction. Yes, an
ErrorBoundary
around the App
component does indeed catch the error thrown (if I remove the match on user.error
). Could make it work for some cases, but looks like a hack to me, since (AFAIU) the ErrorBoundaries are supposed to prevent whole applications crash from unexpected errors, not to handle the expected ones. I would like to have a more fine-grained control over the error handling, e.g. show an error saying "User doesn't exist" under the userId input - not replace the whole component with the wrapping fallback of the ErrorBoundary. Which, AFAIU, the examples in the documentation are trying to show me how to do, but something is amiss.9 replies