diff --git a/internal/cloudapi/v2/handler.go b/internal/cloudapi/v2/handler.go index 1e0d90aeb..e4276fbbc 100644 --- a/internal/cloudapi/v2/handler.go +++ b/internal/cloudapi/v2/handler.go @@ -515,7 +515,7 @@ func (h *apiHandlers) GetComposeStatus(ctx echo.Context, id string) error { return HTTPError(ErrorMalformedOSBuildJobResult) } - if result.JobError != nil && result.JobError.HasDependencyError() { + if result.JobError != nil && result.JobError.IsDependencyError() { err = h.server.workers.CheckBuildDependencies(deps[0], result.JobError) if err != nil { return HTTPError(ErrorGettingBuildDependencyStatus) @@ -606,7 +606,7 @@ func (h *apiHandlers) GetComposeStatus(ctx echo.Context, id string) error { if err != nil { return HTTPError(ErrorMalformedOSBuildJobResult) } - if buildJobResult.JobError != nil && buildJobResult.JobError.HasDependencyError() { + if buildJobResult.JobError != nil && buildJobResult.JobError.IsDependencyError() { err = h.server.workers.CheckBuildDependencies(buildDeps[1], buildJobResult.JobError) if err != nil { return HTTPError(ErrorGettingBuildDependencyStatus) diff --git a/internal/worker/clienterrors/errors.go b/internal/worker/clienterrors/errors.go index 22d865374..c70812eb2 100644 --- a/internal/worker/clienterrors/errors.go +++ b/internal/worker/clienterrors/errors.go @@ -83,7 +83,8 @@ func GetStatusCode(err *Error) StatusCode { } } -func (e *Error) HasDependencyError() bool { +// IsDependencyError returns true if the error means that a dependency of a job failed +func (e *Error) IsDependencyError() bool { switch e.ID { case ErrorDepsolveDependency: return true diff --git a/internal/worker/server.go b/internal/worker/server.go index 0c560d51d..931b5b1da 100644 --- a/internal/worker/server.go +++ b/internal/worker/server.go @@ -154,7 +154,7 @@ func (s *Server) CheckBuildDependencies(dep uuid.UUID, jobErr *clienterrors.Erro } if manifestJobErr := manifestJR.JobError; manifestJobErr != nil { - if !manifestJobErr.HasDependencyError() { + if !manifestJobErr.IsDependencyError() { jobErr.Details = manifestJobErr return nil }