onSnapshotRestorationFailure method
Future<void>
onSnapshotRestorationFailure(
- dynamic snapshotData,
- int sequenceNumber,
- dynamic error
A snapshot that cannot be restored fails recovery instead of eventador's default (empty state plus only the events after the snapshot).
Implementation
@override
Future<void> onSnapshotRestorationFailure(
dynamic snapshotData, int sequenceNumber, dynamic error) async {
throw StateError('Invoice $aggregateId: snapshot at $sequenceNumber cannot be restored '
'(refusing to recover from the events after it alone): $error');
}