1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-20 22:01:10 +02:00

Xiaomi: wrap parsing of activity data in try block

This will prevent uncaught exceptions that occur during the
parsing of activity data from breaking up the activity fetching
chain and causing the task to never get completed.
This commit is contained in:
MrYoranimo 2023-12-04 22:07:02 +01:00
parent 0f83346d65
commit b303da4e62

View File

@ -117,8 +117,14 @@ public class XiaomiActivityFileFetcher {
return;
}
if (!activityParser.parse(mHealthService.getSupport(), fileId, activityData)) {
LOG.warn("Failed to parse {}", fileId);
try {
if (activityParser.parse(mHealthService.getSupport(), fileId, activityData)) {
LOG.info("Successfully parsed {}", fileId);
} else {
LOG.warn("Failed to parse {}", fileId);
}
} catch (final Exception ex) {
LOG.error("addChunk(): failed to parse activity: ", ex);
}
triggerNextFetch();