clean up a bunch of exceptions

This commit is contained in:
Christien Rioux 2025-04-17 18:55:43 -04:00
parent c077a0290f
commit bf38c2c44d
21 changed files with 244 additions and 166 deletions

View file

@ -6,6 +6,7 @@ import 'package:sorted_list/sorted_list.dart';
import 'package:veilid_support/veilid_support.dart';
import '../../../proto/proto.dart' as proto;
import '../../../tools/tools.dart';
import 'author_input_queue.dart';
import 'author_input_source.dart';
import 'output_position.dart';
@ -62,17 +63,24 @@ class MessageReconciliation {
Future<AuthorInputQueue?> _enqueueAuthorInput(
{required TypedKey author,
required AuthorInputSource inputSource}) async {
// Get the position of our most recent reconciled message from this author
final outputPosition = await _findLastOutputPosition(author: author);
try {
// Get the position of our most recent reconciled message from this author
final outputPosition = await _findLastOutputPosition(author: author);
// Find oldest message we have not yet reconciled
final inputQueue = await AuthorInputQueue.create(
author: author,
inputSource: inputSource,
outputPosition: outputPosition,
onError: _onError,
);
return inputQueue;
// Find oldest message we have not yet reconciled
final inputQueue = await AuthorInputQueue.create(
author: author,
inputSource: inputSource,
outputPosition: outputPosition,
onError: _onError,
);
return inputQueue;
// Catch everything so we can avoid ParallelWaitError
// ignore: avoid_catches_without_on_clauses
} catch (e, st) {
log.error('Exception enqueing author input: $e:\n$st\n');
return null;
}
}
// Get the position of our most recent reconciled message from this author