mirror of https://github.com/grpc/grpc-dart.git
Don't print from server (#212)
Co-authored-by: Vyacheslav Egorov <vegorov@google.com>
This commit is contained in:
parent
7ea15a8160
commit
21529c6be7
|
@ -105,8 +105,10 @@ class ConnectionServer {
|
||||||
// timeout.
|
// timeout.
|
||||||
connection.incomingStreams.listen((stream) {
|
connection.incomingStreams.listen((stream) {
|
||||||
handler = serveStream_(stream);
|
handler = serveStream_(stream);
|
||||||
}, onError: (error) {
|
}, onError: (error, stackTrace) {
|
||||||
print('Connection error: $error');
|
if (error is Error) {
|
||||||
|
Zone.current.handleUncaughtError(error, stackTrace);
|
||||||
|
}
|
||||||
}, onDone: () {
|
}, onDone: () {
|
||||||
// TODO(sigurdm): This is not correct behavior in the presence of
|
// TODO(sigurdm): This is not correct behavior in the presence of
|
||||||
// half-closed tcp streams.
|
// half-closed tcp streams.
|
||||||
|
@ -175,11 +177,11 @@ class Server extends ConnectionServer {
|
||||||
final connection = ServerTransportConnection.viaSocket(socket,
|
final connection = ServerTransportConnection.viaSocket(socket,
|
||||||
settings: http2ServerSettings);
|
settings: http2ServerSettings);
|
||||||
serveConnection(connection);
|
serveConnection(connection);
|
||||||
}, onError: _printSocketError);
|
}, onError: (error, stackTrace) {
|
||||||
|
if (error is Error) {
|
||||||
|
Zone.current.handleUncaughtError(error, stackTrace);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
void _printSocketError(Object error) {
|
|
||||||
print('Socket error: $error');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
|
|
Loading…
Reference in New Issue