mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-07-17 01:27:22 +02:00
Add error handling and update documentation
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>?;
|
||||
|
||||
Reference in New Issue
Block a user