diff --git a/lib/domain/rpc/command_dispatcher.dart b/lib/domain/rpc/command_dispatcher.dart index acd2a101d..ba7c84573 100644 --- a/lib/domain/rpc/command_dispatcher.dart +++ b/lib/domain/rpc/command_dispatcher.dart @@ -145,7 +145,7 @@ class CommandDispatcher { .handle(command.command) .then( command.completer.complete, - onError: (error) => command.completer.complete(Result.failure(error)), + onError: command.completer.completeError, ) .whenComplete(_process); } diff --git a/lib/infrastructure/rpc/dto/rpc_command_handler.dart b/lib/infrastructure/rpc/dto/rpc_command_handler.dart index 0dd003656..3c5426e5f 100644 --- a/lib/infrastructure/rpc/dto/rpc_command_handler.dart +++ b/lib/infrastructure/rpc/dto/rpc_command_handler.dart @@ -35,6 +35,9 @@ abstract class RPCCommandHandler { } on TypeError catch (e, stack) { _logger.severe('Invalid data', e, stack); return const Result.failure(awc.Failure.invalidParams); + } catch (e, stack) { + _logger.severe('Command failed', e, stack); + return const Result.failure(awc.Failure.other); } } }