Add error handling and update documentation

This commit is contained in:
ALPR Watch
2025-12-03 07:35:18 +01:00
parent 043a036075
commit 3f83d67bc1
3 changed files with 5 additions and 6 deletions

View File

@@ -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.
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.

View File

@@ -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 {

View File

@@ -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<String, dynamic>?;