TanStackT
TanStack2y ago
3 replies
ordinary-sapphire

Error Handling Mechanism

Hi, i have a question regarding the error handling mechanism

For the query function I provide the following arrow function:

() => axios.get('url').then(res => return res.data)

Why does react query know about the error that axios has if something went wrong? I’m returning the data and not the promise where .catch()’ could be used by react query.

Could you help me to understand how this works?
Was this page helpful?