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
+1
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 {
+2 -3
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>?;