mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 22:52:33 +02:00
Merge pull request #4691 from joostjager/sendtoroute-status-code
routerrpc: map errors to grpc status code
This commit is contained in:
@@ -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