From 3f83d67bc180fca122b79d1af0e38b8c94d0254d Mon Sep 17 00:00:00 2001 From: ALPR Watch Date: Wed, 3 Dec 2025 07:35:18 +0100 Subject: [PATCH] Add error handling and update documentation --- DEVELOPER.md | 5 ++--- lib/dev_config.dart | 1 + lib/services/routing_service.dart | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/DEVELOPER.md b/DEVELOPER.md index f631e58..15ac2e3 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -488,8 +488,7 @@ The major performance issue was discovered to be double caching with expensive o **Current state:** - **Search functionality**: Fully implemented and active -- **Basic routing**: Complete but disabled pending API integration -- **Avoidance routing**: Awaiting alprwatch.org/directions API +- **Avoidance routing**: Fully implemented and active - **Offline routing**: Requires vector map tiles **Architecture:** @@ -848,4 +847,4 @@ debugPrint('[ComponentName] Detailed message: $data'); --- -This documentation should be updated as the architecture evolves. When making significant changes, update both the relevant section here and add a brief note explaining the rationale for the change. \ No newline at end of file +This documentation should be updated as the architecture evolves. When making significant changes, update both the relevant section here and add a brief note explaining the rationale for the change. diff --git a/lib/dev_config.dart b/lib/dev_config.dart index b0597d0..5baf113 100644 --- a/lib/dev_config.dart +++ b/lib/dev_config.dart @@ -77,6 +77,7 @@ const bool kEnableNodeExtraction = false; // Set to true to enable extract from /// Navigation availability: only dev builds, and only when online bool enableNavigationFeatures({required bool offlineMode}) { + return true; if (!kEnableDevelopmentModes) { return false; // Release builds: never allow navigation } else { diff --git a/lib/services/routing_service.dart b/lib/services/routing_service.dart index 5fd96b0..781936d 100644 --- a/lib/services/routing_service.dart +++ b/lib/services/routing_service.dart @@ -84,9 +84,8 @@ class RoutingService { // Check alprwatch response status final ok = data['ok'] as bool? ?? false; if ( ! ok ) { - final code = data['error']['code'] as String? ?? 'Unknown routing error code'; - final message = data['error']['message'] as String? ?? 'Unknown routing error'; - throw RoutingException('alprwatch error ($code): $message'); + final message = data['error'] as String? ?? 'Unknown routing error'; + throw RoutingException('alprwatch error: $message'); } final route = data['result']['route'] as Map?;