You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-07-12 22:21:40 +02:00
Enable gocritic
and don't ignore globally (#3159)
Use `nolint` directives instead. From #2960
This commit is contained in:
@ -29,15 +29,16 @@ import (
|
||||
)
|
||||
|
||||
func handlePipelineErr(c *gin.Context, err error) {
|
||||
if errors.Is(err, &pipeline.ErrNotFound{}) {
|
||||
switch {
|
||||
case errors.Is(err, &pipeline.ErrNotFound{}):
|
||||
c.String(http.StatusNotFound, "%s", err)
|
||||
} else if errors.Is(err, &pipeline.ErrBadRequest{}) {
|
||||
case errors.Is(err, &pipeline.ErrBadRequest{}):
|
||||
c.String(http.StatusBadRequest, "%s", err)
|
||||
} else if errors.Is(err, pipeline.ErrFiltered) {
|
||||
case errors.Is(err, pipeline.ErrFiltered):
|
||||
// for debugging purpose we add a header
|
||||
c.Writer.Header().Add("Pipeline-Filtered", "true")
|
||||
c.Status(http.StatusNoContent)
|
||||
} else {
|
||||
default:
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user