Skip to content
Snippets Groups Projects
Commit f31dcbe2 authored by S.H.'s avatar S.H.
Browse files

Output parsing errors in northbound/server/topology.go

parent 4b6b6f7d
No related branches found
No related tags found
No related merge requests found
Pipeline #263772 failed
...@@ -3,6 +3,7 @@ package server ...@@ -3,6 +3,7 @@ package server
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"time" "time"
topopb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology" topopb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology"
...@@ -51,6 +52,8 @@ func (t TopologyServer) checkForValidationErrors(request protoreflect.ProtoMessa ...@@ -51,6 +52,8 @@ func (t TopologyServer) checkForValidationErrors(request protoreflect.ProtoMessa
if ok := errors.As(err, &valErr); ok { if ok := errors.As(err, &valErr); ok {
protoErr := valErr.ToProto() protoErr := valErr.ToProto()
grpcError, _ := status.New(codes.Aborted, "Validation failed").WithDetails(protoErr) grpcError, _ := status.New(codes.Aborted, "Validation failed").WithDetails(protoErr)
fmt.Printf("valErr: %v\n", valErr)
fmt.Printf("err: %v\n", err)
return grpcError.Err() return grpcError.Err()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment