Skip to content

Commit 0ae7e7e

Browse files
committed
Added proc not found error
Signed-off-by: Darren Stahl <[email protected]>
1 parent a799400 commit 0ae7e7e

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

errors.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ var (
4141

4242
// ErrVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously
4343
ErrVmcomputeOperationPending = syscall.Errno(0xC0370103)
44+
45+
// ErrVmcomputeOperationInvalidState is an error encountered when the compute system is not in a valid state for the requested operation
46+
ErrVmcomputeOperationInvalidState = syscall.Errno(0xc0370105)
47+
48+
// ErrProcNotFound is an error encountered when the the process cannot be found
49+
ErrProcNotFound = syscall.Errno(0x7f)
4450
)
4551

4652
// ProcessError is an error encountered in HCS during an operation on a Process object
@@ -137,11 +143,12 @@ func makeProcessError(process *process, operation string, extraInfo string, err
137143
// IsNotExist checks if an error is caused by the Container or Process not existing.
138144
// Note: Currently, ErrElementNotFound can mean that a Process has either
139145
// already exited, or does not exist. Both IsAlreadyStopped and IsNotExist
140-
// will currently return true when the error is ErrElementNotFound.
146+
// will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
141147
func IsNotExist(err error) bool {
142148
err = getInnerError(err)
143149
return err == ErrComputeSystemDoesNotExist ||
144-
err == ErrElementNotFound
150+
err == ErrElementNotFound ||
151+
err == ErrProcNotFound
145152
}
146153

147154
// IsPending returns a boolean indicating whether the error is that
@@ -162,11 +169,12 @@ func IsTimeout(err error) bool {
162169
// a Container or Process being already stopped.
163170
// Note: Currently, ErrElementNotFound can mean that a Process has either
164171
// already exited, or does not exist. Both IsAlreadyStopped and IsNotExist
165-
// will currently return true when the error is ErrElementNotFound.
172+
// will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
166173
func IsAlreadyStopped(err error) bool {
167174
err = getInnerError(err)
168175
return err == ErrVmcomputeAlreadyStopped ||
169-
err == ErrElementNotFound
176+
err == ErrElementNotFound ||
177+
err == ErrProcNotFound
170178
}
171179

172180
func getInnerError(err error) error {

0 commit comments

Comments
 (0)