Skip to content

Commit

Permalink
Merge branch 'feature/debug-bundle' of github.com:redpanda-data/conso…
Browse files Browse the repository at this point in the history
…le into feature/debug-bundle
  • Loading branch information
jvorcak committed Nov 4, 2024
2 parents 96cdc49 + ca19512 commit 3f3c5ed
Show file tree
Hide file tree
Showing 22 changed files with 2,111 additions and 124 deletions.
8 changes: 0 additions & 8 deletions backend/pkg/api/connect/interceptor/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ package interceptor
import (
"context"
"errors"
"fmt"

commonv1alpha1 "buf.build/gen/go/redpandadata/common/protocolbuffers/go/redpanda/api/common/v1alpha1"
"connectrpc.com/connect"
Expand Down Expand Up @@ -59,17 +58,13 @@ func (in *ValidationInterceptor) WrapUnary(next connect.UnaryFunc) connect.Unary
return next(ctx, req)
}

fmt.Printf("VALIDATE ERROR: %+v\n", err)

var badRequest *errdetails.BadRequest
var validationErr *protovalidate.ValidationError
var runtimeErr *protovalidate.RuntimeError
var compilationErr *protovalidate.CompilationError

switch {
case errors.As(err, &validationErr):

fmt.Printf("IS VALIDATE ERROR\n")
var fieldViolations []*errdetails.BadRequest_FieldViolation
for _, violation := range validationErr.Violations {
fieldViolationErr := &errdetails.BadRequest_FieldViolation{
Expand All @@ -78,9 +73,6 @@ func (in *ValidationInterceptor) WrapUnary(next connect.UnaryFunc) connect.Unary
}
fieldViolations = append(fieldViolations, fieldViolationErr)
}

fmt.Printf("fieldViolations:%+v\n", fieldViolations)

badRequest = apierrors.NewBadRequest(fieldViolations...)
case errors.As(err, &runtimeErr):
in.logger.Error("validation runtime error", zap.Error(runtimeErr))
Expand Down
325 changes: 325 additions & 0 deletions backend/pkg/protogen/redpanda/api/common/v1/errordetails.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3f3c5ed

Please sign in to comment.