diff --git a/src/server/v2.0/handler/project.go b/src/server/v2.0/handler/project.go index 205d66336..a0e33285c 100644 --- a/src/server/v2.0/handler/project.go +++ b/src/server/v2.0/handler/project.go @@ -150,7 +150,7 @@ func (a *projectAPI) CreateProject(ctx context.Context, params operation.CreateP // validate metadata.public value, should only be "true" or "false" if p := req.Metadata.Public; p != "" { if p != "true" && p != "false" { - return a.SendError(ctx, errors.Errorf("metadata.public should only be 'true' or 'false', but got: '%s'", p)) + return a.SendError(ctx, errors.BadRequestError(nil).WithMessage(fmt.Sprintf("metadata.public should only be 'true' or 'false', but got: '%s'", p))) } }