Add version files and update imports for trip model; enhance error handling
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import "dart:typed_data";
|
||||
import "../models/trip.dart";
|
||||
import "package:flutter/foundation.dart";
|
||||
import "../models/operations/trip.dart";
|
||||
import "../models/brr_metadata.dart";
|
||||
import "../exporters/brr_exporter.dart";
|
||||
import "../exporters/arriva_brr_exporter.dart";
|
||||
@@ -37,8 +38,10 @@ class BRRExportService {
|
||||
try {
|
||||
final bytes = await _exporter.export(trips, metadata);
|
||||
return ExportResult.success(bytes);
|
||||
} catch (e) {
|
||||
} catch (e, stackTrace) {
|
||||
debugPrint("[BRRExportService] exportBRR failed: $e");
|
||||
debugPrintStack(stackTrace: stackTrace);
|
||||
return ExportResult.error(["Export failed: $e"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "dart:convert";
|
||||
import "package:flutter/foundation.dart";
|
||||
import "package:hive_flutter/hive_flutter.dart";
|
||||
import "../models/brr_state.dart";
|
||||
|
||||
@@ -21,7 +22,9 @@ class StorageService {
|
||||
|
||||
try {
|
||||
return BRRState.fromJson(jsonDecode(jsonString) as Map<String, dynamic>);
|
||||
} catch (e) {
|
||||
} catch (e, stackTrace) {
|
||||
debugPrint("[StorageService] loadState failed: $e");
|
||||
debugPrintStack(stackTrace: stackTrace);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user