change grpc code to permission denied

This commit is contained in:
crn4
2025-06-16 13:10:38 +02:00
parent 3cd21cc7e5
commit 19835dc6d5

View File

@@ -345,7 +345,7 @@ func mapError(ctx context.Context, err error) error {
}
}
if errors.Is(err, internalStatus.ErrPeerAlreadyLoggedIn) {
return status.Error(codes.AlreadyExists, internalStatus.ErrPeerAlreadyLoggedIn.Error())
return status.Error(codes.PermissionDenied, internalStatus.ErrPeerAlreadyLoggedIn.Error())
}
log.WithContext(ctx).Errorf("got an unhandled error: %s", err)
return status.Errorf(codes.Internal, "failed handling request")