fix(setup): report why DeviceInfo.xml could not be read

The GetExactDeviceInfo error was discarded and every failure reported as
"DeviceInfo.xml is not persisted", so a malformed file or an I/O error was
diagnosed as a missing sync and the user was told to run Data Sync, which is
the wrong remedy for either.

Include the cause, as the neighbouring branches already do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tobias Gesellchen
2026-09-05 21:55:20 +02:00
co-authored by Claude Opus 5
parent a3566f6691
commit b43fb05ea1
+3 -1
View File
@@ -75,7 +75,9 @@ func (m *Manager) checkMigrationDataReady(deviceIP string) ([]string, error) {
persistedInfo, err := m.DataStore.GetExactDeviceInfo(accountID, deviceID)
if err != nil {
return nil, migrationDataNotReadyf("DeviceInfo.xml is not persisted under account %q and device %q", accountID, deviceID)
// Report the cause: a malformed file or an I/O error is not a missing
// sync, and Data Sync is then the wrong remedy to suggest.
return nil, migrationDataNotReadyf("cannot read DeviceInfo.xml under account %q and device %q: %v", accountID, deviceID, err)
}
if persistedInfo.DeviceID != deviceID {