worker/clienterrors: depenency error check
Add a helper function to check for dependency errors for job errors. This simply returns true if a job error has a dependency error code and false otherwise.
This commit is contained in:
parent
b1969ba6a6
commit
30d75d0e74
1 changed files with 11 additions and 0 deletions
|
|
@ -78,6 +78,17 @@ func GetStatusCode(err *Error) StatusCode {
|
|||
}
|
||||
}
|
||||
|
||||
func (e *Error) HasDependencyError() bool {
|
||||
switch e.ID {
|
||||
case ErrorDepsolveDependency:
|
||||
return true
|
||||
case ErrorManifestDependency:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func WorkerClientError(code ClientErrorCode, reason string, details ...interface{}) *Error {
|
||||
return &Error{
|
||||
ID: code,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue