mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-24 10:42:47 +03:00
Merge PR #43.
This commit is contained in:
commit
6b841f4a88
@ -60,7 +60,14 @@ class RpcSession {
|
||||
: _responses = StreamQueue(_process.stdout
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.map((event) => RpcResponse.fromJson(jsonDecode(event)))) {
|
||||
.map((event) {
|
||||
try {
|
||||
return RpcResponse.fromJson(jsonDecode(event));
|
||||
} catch (e) {
|
||||
_log.severe('Response was not valid JSON', event);
|
||||
return RpcResponse.error('invalid-response', e.toString(), {});
|
||||
}
|
||||
})) {
|
||||
_process.stderr
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
|
Loading…
Reference in New Issue
Block a user