RxCommand.createFromStream() with a type Stream as provider does not emit an exception.
baku-apps opened this issue · 2 comments
var streamController =
StreamController<String>.broadcast();
var command = RxCommand.createFromStream((_) {
return streamController.stream.map((rideMap) {
throw Exception();
});
});
command.results.listen((r) {
print(r.toString());
});
command.thrownExceptions.listen((e) {
print(e.toString());
});
command.execute();
streamController.add('test');
The following code does not emit to thrownException. If we change the stream for an Observable.just('test')
, it will emit the error. I have a suspicion that the addStream()
in the execute()
does not work correctly. (line 646 in rx_command.dart: _commandResultsSubject.addStream(inputObservable).then((_) {
)
When I replaced code of the RxCommandAsync execute()
it did emit the error.
Perhaps I'm creating the streamprovider incorrect? This is a simplified example.
In real life I'm returning a firestore stream and transform the data in the map(), which could cause an exception. Would appreciate some help.
Thanks, and merry xmass!
merry xmass to you too.
This wasn't reallya bug because it happened because you never closed the input controller. Still I now changed the implementation in V 4.3.4 so that it will always work. I added your example as new test