Skip to content

Commit

Permalink
No exit on error
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Jun 12, 2024
1 parent 7c9830e commit b1f0d94
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions grpc-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ func (multi *MultiEpoch) Get(ser old_faithful_grpc.OldFaithful_GetServer) error
if err != nil {
gerr, ok := status.FromError(err)
if ok {
return ser.Send(&old_faithful_grpc.GetResponse{
err := ser.Send(&old_faithful_grpc.GetResponse{
Id: id,
Response: &old_faithful_grpc.GetResponse_Error{
Error: &old_faithful_grpc.GetResponseError{
Expand All @@ -472,6 +472,10 @@ func (multi *MultiEpoch) Get(ser old_faithful_grpc.OldFaithful_GetServer) error
},
},
})
if err != nil {
return status.Errorf(codes.Internal, "request %d; failed to send block error response: %v", id, err)
}
continue
}
return status.Errorf(codes.Internal, "request %d; failed to get block: %v", id, err)
}
Expand All @@ -487,7 +491,7 @@ func (multi *MultiEpoch) Get(ser old_faithful_grpc.OldFaithful_GetServer) error
if err != nil {
gerr, ok := status.FromError(err)
if ok {
return ser.Send(&old_faithful_grpc.GetResponse{
err := ser.Send(&old_faithful_grpc.GetResponse{
Id: id,
Response: &old_faithful_grpc.GetResponse_Error{
Error: &old_faithful_grpc.GetResponseError{
Expand All @@ -503,6 +507,10 @@ func (multi *MultiEpoch) Get(ser old_faithful_grpc.OldFaithful_GetServer) error
},
},
})
if err != nil {
return status.Errorf(codes.Internal, "request %d; failed to send transaction error response: %v", id, err)
}
continue
}
return status.Errorf(codes.Internal, "request %d; failed to get transaction: %v", id, err)
}
Expand All @@ -518,7 +526,7 @@ func (multi *MultiEpoch) Get(ser old_faithful_grpc.OldFaithful_GetServer) error
if err != nil {
gerr, ok := status.FromError(err)
if ok {
return ser.Send(&old_faithful_grpc.GetResponse{
err := ser.Send(&old_faithful_grpc.GetResponse{
Id: id,
Response: &old_faithful_grpc.GetResponse_Error{
Error: &old_faithful_grpc.GetResponseError{
Expand All @@ -534,6 +542,10 @@ func (multi *MultiEpoch) Get(ser old_faithful_grpc.OldFaithful_GetServer) error
},
},
})
if err != nil {
return status.Errorf(codes.Internal, "request %d; failed to send version error response: %v", id, err)
}
continue
}
return status.Errorf(codes.Internal, "request %d; failed to get version: %v", id, err)
}
Expand Down

0 comments on commit b1f0d94

Please sign in to comment.