You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Move "skip ci" logic into global pipeline conditions (#2216)
... and make custom errors follow std err conventions this fix a 500 response if the whole pipeline is filtered out
This commit is contained in:
@@ -22,6 +22,14 @@ func (e ErrNotFound) Error() string {
|
||||
return e.Msg
|
||||
}
|
||||
|
||||
func (e ErrNotFound) Is(target error) bool {
|
||||
_, ok := target.(ErrNotFound) //nolint:errorlint
|
||||
if !ok {
|
||||
_, ok = target.(*ErrNotFound) //nolint:errorlint
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
type ErrBadRequest struct {
|
||||
Msg string
|
||||
}
|
||||
@@ -30,6 +38,14 @@ func (e ErrBadRequest) Error() string {
|
||||
return e.Msg
|
||||
}
|
||||
|
||||
func (e ErrBadRequest) Is(target error) bool {
|
||||
_, ok := target.(ErrBadRequest) //nolint:errorlint
|
||||
if !ok {
|
||||
_, ok = target.(*ErrBadRequest) //nolint:errorlint
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
type ErrFiltered struct {
|
||||
Msg string
|
||||
}
|
||||
@@ -37,3 +53,11 @@ type ErrFiltered struct {
|
||||
func (e ErrFiltered) Error() string {
|
||||
return "ignoring hook: " + e.Msg
|
||||
}
|
||||
|
||||
func (e *ErrFiltered) Is(target error) bool {
|
||||
_, ok := target.(ErrFiltered) //nolint:errorlint
|
||||
if !ok {
|
||||
_, ok = target.(*ErrFiltered) //nolint:errorlint
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user