redis-dart
redis-dart copied to clipboard
Lazy Stream String-type error is hard to handle
The LazyStream / StreamNext will return a Future.error(String): https://github.com/ra1u/redis-dart/blob/master/lib/lazystream.dart#L62
It's hard to catch at a higher level and parse out what happened and what the system should do next.
Changing this to return a typed error would be easier to understand and work with. Consider either a custom error that implements Exception or even just using StateError would be okay.
Thank for this. I think you are on point. If you can make PR that would be great. My concern is only about backward compatibility.
You're right, backwards compatibility is an issue here. https://xkcd.com/1172/
We have a few options off the top of my head -- each have some tradeoffs:
- Bump the major semver
- Post a note that we're subtly breaking the api (like the Dart team does -- lol!)
- Create a new api in
LazyStream
and expose it as an optional parameter in theRedisConnection.connect