-
Notifications
You must be signed in to change notification settings - Fork 0
/
job.go
30 lines (26 loc) · 962 Bytes
/
job.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package v7action
import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
)
func (actor Actor) PollUploadBuildpackJob(jobURL ccv3.JobURL) (Warnings, error) {
warnings, err := actor.CloudControllerClient.PollJob(jobURL)
if err != nil {
switch v := err.(type) {
case ccerror.V3JobFailedError:
switch v.Code {
case 290000:
return Warnings(warnings), ccerror.BuildpackAlreadyExistsForStackError{Message: v.Detail}
case 290003:
return Warnings(warnings), ccerror.BuildpackAlreadyExistsWithoutStackError{Message: v.Detail}
case 390011:
return Warnings(warnings), ccerror.BuildpackStacksDontMatchError{Message: v.Detail}
case 390012:
return Warnings(warnings), ccerror.BuildpackStackDoesNotExistError{Message: v.Detail}
case 390013:
return Warnings(warnings), ccerror.BuildpackZipInvalidError{Message: v.Detail}
}
}
}
return Warnings(warnings), err
}