Triggering a sync from the WebUI while the device has no internet-connection will result in a generic "sync failed"-message.
Looking into the inspector however, we can see the actual error message "Could not connect to pretix.eu/[IPv6 here]".
Passing that message to the alert()-box would probably make debugging easier.