solidjs createResource doesn't show error when there was an error i.e 401 Invalid credentials
createResource data.error always false
8 Replies
error
is only present when the fetcher function throws. fetch
won't throw as long as there's a valid response, even if it's a 401SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
i assume the
peopl/
is intentional? json()
is throwing a syntax error since the html response isn't valid json, it's not the fetch that's throwingThank you for your explanation 😊, I will use axios instead of fetch.
ah yeah axios throws on non-200 aye
GitHub
GitHub - kwhitley/itty-fetcher: An even simpler wrapper around nati...
An even simpler wrapper around native Fetch to strip boilerplate from your fetching code! - kwhitley/itty-fetcher
Size of axios v1.6.7 is 30.5 kB (minified), and 11.7 kB when compressed using GZIP.
Size of itty-fetcher 0.9.4 is 1.3kB (minified), and 784B when compressed using GZIP.