summaryrefslogtreecommitdiff
path: root/lib/model/motive_selection
diff options
context:
space:
mode:
authoruvok2026-05-03 15:55:08 +0200
committeruvok2026-05-03 15:55:08 +0200
commit098dcbbfac422d6888d277cd0bc0f4b0d28dd9d1 (patch)
tree2f8e1b588e82a3b5674c1bb22f530e0433dcc440 /lib/model/motive_selection
parentfe5d86f92a34ad03a038d729561e9e9884bf5322 (diff)
Update UniversalBle
Diffstat (limited to 'lib/model/motive_selection')
-rw-r--r--lib/model/motive_selection/universal_blue_motive_selection.dart12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/model/motive_selection/universal_blue_motive_selection.dart b/lib/model/motive_selection/universal_blue_motive_selection.dart
index 084541a..e523d91 100644
--- a/lib/model/motive_selection/universal_blue_motive_selection.dart
+++ b/lib/model/motive_selection/universal_blue_motive_selection.dart
@@ -21,6 +21,9 @@ import 'package:uvok_epaper_badge/badge_exception.dart';
import 'package:uvok_epaper_badge/model/badge_motive.dart';
import 'package:uvok_epaper_badge/model/device/universal_ble_device.dart';
import 'package:uvok_epaper_badge/model/motive_selection/badge_motive_selection.dart';
+import 'package:uvok_epaper_badge/log.dart';
+
+var logger = fileLogger();
class UniversalBlueMotiveSelection
with BadgeParser
@@ -65,7 +68,8 @@ class UniversalBlueMotiveSelection
(bm) => bm.id == currentMotive,
orElse: () => throw BadgeException("Selected motive not in templates"),
);
- } on NotFoundException {
+ } on UniversalBleException catch (e) {
+ logger.e(e.toString());
throw BadgeException("Characeristic/Service not found.");
}
}
@@ -81,7 +85,8 @@ class UniversalBlueMotiveSelection
);
var val = await c.read();
_cachedMotives = parseBadgeMotives(val);
- } on NotFoundException {
+ } on UniversalBleException catch (e) {
+ logger.e(e.toString());
throw BadgeException("Characeristic/Service not found.");
}
@@ -104,7 +109,8 @@ class UniversalBlueMotiveSelection
);
await c.write(ascii.encode(motive.id.toString()), withResponse: true);
- } on NotFoundException {
+ } on UniversalBleException catch (e) {
+ logger.e(e.toString());
throw BadgeException("Characeristic/Service not found.");
}
}