report metadata read/write issues only when file exists

This commit is contained in:
Thibault Deckers 2021-10-27 17:09:27 +09:00
parent dd45f5a368
commit 7ee6207d93
2 changed files with 24 additions and 8 deletions

View file

@ -44,7 +44,9 @@ class PlatformMetadataEditService implements MetadataEditService {
});
if (result != null) return (result as Map).cast<String, dynamic>();
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return {};
}
@ -58,7 +60,9 @@ class PlatformMetadataEditService implements MetadataEditService {
});
if (result != null) return (result as Map).cast<String, dynamic>();
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return {};
}
@ -74,7 +78,9 @@ class PlatformMetadataEditService implements MetadataEditService {
});
if (result != null) return (result as Map).cast<String, dynamic>();
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return {};
}
@ -88,7 +94,9 @@ class PlatformMetadataEditService implements MetadataEditService {
});
if (result != null) return (result as Map).cast<String, dynamic>();
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return {};
}

View file

@ -72,7 +72,9 @@ class PlatformMetadataFetchService implements MetadataFetchService {
result['contentId'] = entry.contentId;
return CatalogMetadata.fromMap(result);
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return null;
}
@ -98,7 +100,9 @@ class PlatformMetadataFetchService implements MetadataFetchService {
}) as Map;
return OverlayMetadata.fromMap(result);
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return null;
}
@ -140,7 +144,9 @@ class PlatformMetadataFetchService implements MetadataFetchService {
}) as Map;
return PanoramaInfo.fromMap(result);
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return null;
}
@ -173,7 +179,9 @@ class PlatformMetadataFetchService implements MetadataFetchService {
'prop': prop,
});
} on PlatformException catch (e, stack) {
await reportService.recordError(e, stack);
if (!entry.isMissingAtPath) {
await reportService.recordError(e, stack);
}
}
return null;
}