Skip to content

Commit

Permalink
change fmt.Errorf to errors.New (#968)
Browse files Browse the repository at this point in the history
change fmt.Errorf to errors.NewBadRequest

Co-authored-by: drzhangg <[email protected]>
  • Loading branch information
ks-ci-bot and drzhangg committed Jun 30, 2023
1 parent 55cc9ad commit 8c504aa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/kapis/devops/v1alpha3/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1alpha3

import (
"fmt"
"github.com/emicklei/go-restful"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -414,7 +413,7 @@ func (h *devopsHandler) CheckDevopsName(request *restful.Request, response *rest
}
errorHandle(request, response, result, nil)
default:
errorHandle(request, response, nil, fmt.Errorf("generateNameFlag can not be false"))
errorHandle(request, response, nil, errors.NewBadRequest("generateNameFlag can not be false"))
}
} else {
kapis.HandleBadRequest(response, request, err)
Expand Down

0 comments on commit 8c504aa

Please sign in to comment.