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

View file

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