Compare commits

..

2 commits

Author SHA1 Message Date
Vadim
a1ce17d675
ML-154 Improved EXIF errors reporting (#159)
* removed unused analytics event & added `logCrash`

* added analytics to `RemoteConfigService`

* run app with `runZonedGuarded`

* added crash logging to `CameraContainerBloc`

* log product id for IAP errors

* typo

* log crashes in `RemoteConfigService`

* ignore silent `FlutterError`

* fixed `evFromImage` test

* fixed `showBuyProDialog` test

* log errors in console

* depend on iap 0.7.2

* Made errors non-fatal by default

* improved EXIF errors reporting

* fixed tests
2024-02-13 19:33:40 +01:00
Vadim
4f4b6cf1eb
ML-154 Made errors non-fatal by default (#158)
* removed unused analytics event & added `logCrash`

* added analytics to `RemoteConfigService`

* run app with `runZonedGuarded`

* added crash logging to `CameraContainerBloc`

* log product id for IAP errors

* typo

* log crashes in `RemoteConfigService`

* ignore silent `FlutterError`

* fixed `evFromImage` test

* fixed `showBuyProDialog` test

* log errors in console

* depend on iap 0.7.2

* Made errors non-fatal by default
2024-02-13 18:19:43 +01:00
3 changed files with 9 additions and 3 deletions

View file

@ -36,7 +36,6 @@ class LightmeterAnalyticsFirebase implements ILightmeterAnalyticsApi {
stackTrace,
reason: reason,
information: information,
fatal: true,
);
}

View file

@ -10,7 +10,14 @@ Future<double> evFromImage(Uint8List bytes) async {
final apertureValueRatio = (tags["EXIF FNumber"]?.values as IfdRatios?)?.ratios.first;
final speedValueRatio = (tags["EXIF ExposureTime"]?.values as IfdRatios?)?.ratios.first;
if (iso == null || apertureValueRatio == null || speedValueRatio == null) {
throw FlutterError('Error parsing EXIF: ${tags.keys}');
throw ArgumentError(
'Error parsing EXIF: ${tags.keys.join(', ')}',
[
if (iso == null) 'EXIF ISOSpeedRatings',
if (apertureValueRatio == null) 'EXIF FNumber',
if (speedValueRatio == null) 'EXIF ExposureTime',
].join(', '),
);
}
final aperture = apertureValueRatio.numerator / apertureValueRatio.denominator;

View file

@ -17,7 +17,7 @@ void main() {
'no EXIF',
() {
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
expectLater(evFromImage(bytes), throwsFlutterError);
expectLater(evFromImage(bytes), throwsArgumentError);
},
);
});