earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
624 stars 18 forks source link

Improve web sync errors thrown from WebSockets. #298

Closed sgwilym closed 1 year ago

sgwilym commented 1 year ago

What's the problem you solved?

If a failure occurred during sync over HTTP, the user would only get an uninformative 'Websocket error' message. Even for commonplace failures like the server not being reachable, or the endpoint not being valid.

What solution are you recommending?

I'm now passing the original errors along, so users get more useful messages like DOMException: failed to connect to WebSocket: HTTP error: 404 Not Found.