The useOfflineMutation doesn't catch server errors. If you wrap the returned runMutation function from the hook in a try/catch block and use async/await, you can catch the server errors. However, offline errors are never resolved or rejected and if the client is offline, the page just hangs until the client comes back online. A potential solution for this is to reject offline errors in the useOfflineMutation hook and handle the offline error on the client, e.g:
Bug Report
The useOfflineMutation doesn't catch server errors. If you wrap the returned
runMutation
function from the hook in a try/catch block and use async/await, you can catch the server errors. However, offline errors are never resolved or rejected and if the client is offline, the page just hangs until the client comes back online. A potential solution for this is to reject offline errors in theuseOfflineMutation
hook and handle the offline error on the client, e.g: