Merge pull request #4691 from joostjager/sendtoroute-status-code
routerrpc: map errors to grpc status code
This commit is contained in:
commit
c2bba7ed71
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user