Skip to content

WsZ21Service ctor may throw #125

@higaski

Description

@higaski

WsZ21Service(String domain) {
_channel = WebSocketChannel.connect(Uri.parse('ws://$domain/roco/z21/'));
_channel.ready.then(
(_) => lanSetBroadcastFlags(
BroadcastFlags.fromList([
BroadcastFlag.DrivingSwitching,
BroadcastFlag.RBus,
BroadcastFlag.LocoNet,
BroadcastFlag.LocoNetDetector,
]),
),
);
_stream = _channel.stream
.asBroadcastStream()
.cast<Uint8List>()
.map(Z21Service.convert);
}

.ready.then can throw here and at this point this particular Future is fire-and-forget and lives outside of Riverpod's error handling...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions