mirror of https://github.com/grpc/grpc-dart.git
parent
c7e07a09a5
commit
1c18e38252
|
@ -1,3 +1,7 @@
|
|||
## 3.2.4-wip
|
||||
|
||||
* Forward internal `GrpcError` on when throwing while sending a request.
|
||||
|
||||
## 3.2.3
|
||||
|
||||
* Add const constructor to `GrpcError` fixing #606.
|
||||
|
|
|
@ -207,7 +207,9 @@ class ClientCall<Q, R> implements Response {
|
|||
_terminateWithError(GrpcError.unavailable('Error connecting: $error'));
|
||||
}
|
||||
|
||||
void _terminateWithError(GrpcError error) {
|
||||
void _terminateWithError(Object e) {
|
||||
final error =
|
||||
e is GrpcError ? e : GrpcError.unavailable('Error making call: $e');
|
||||
_finishTimelineWithError(error, _requestTimeline);
|
||||
_responses.addErrorIfNotClosed(error);
|
||||
_safeTerminate();
|
||||
|
@ -245,14 +247,10 @@ class ClientCall<Q, R> implements Response {
|
|||
(MetadataProvider provider) => provider(metadata,
|
||||
'${connection.scheme}://${connection.authority}${audiencePath(_method)}'))
|
||||
.then((_) => _sendRequest(connection, _sanitizeMetadata(metadata)))
|
||||
.catchError(_onMetadataProviderError);
|
||||
.catchError(_terminateWithError);
|
||||
}
|
||||
}
|
||||
|
||||
void _onMetadataProviderError(error) {
|
||||
_terminateWithError(GrpcError.internal('Error making call: $error'));
|
||||
}
|
||||
|
||||
void _sendRequest(ClientConnection connection, Map<String, String> metadata) {
|
||||
late final GrpcTransportStream stream;
|
||||
try {
|
||||
|
@ -264,7 +262,7 @@ class ClientCall<Q, R> implements Response {
|
|||
callOptions: options,
|
||||
);
|
||||
} catch (e) {
|
||||
_terminateWithError(GrpcError.unavailable('Error making call: $e'));
|
||||
_terminateWithError(e);
|
||||
return;
|
||||
}
|
||||
_requestTimeline?.instant('Request sent', arguments: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: grpc
|
||||
description: Dart implementation of gRPC, a high performance, open-source universal RPC framework.
|
||||
version: 3.2.3
|
||||
version: 3.2.4-wip
|
||||
|
||||
repository: https://github.com/grpc/grpc-dart
|
||||
|
||||
|
|
Loading…
Reference in New Issue