Merge pull request #4691 from joostjager/sendtoroute-status-code
routerrpc: map errors to grpc status code
This commit is contained in:
1 file changed
+7
@@ -368,6 +368,13 @@ func (s *Server) SendToRouteV2(ctx context.Context,
|
|||||||
return rpcAttempt, nil
|
return rpcAttempt, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Transform user errors to grpc code.
|
||||||
|
if err == channeldb.ErrPaymentInFlight ||
|
||||||
|
err == channeldb.ErrAlreadyPaid {
|
||||||
|
|
||||||
|
return nil, status.Error(codes.AlreadyExists, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user