Documentation ¶
Index ¶
- Constants
- func BaseStackTrace(e error) errors.StackTrace
- func NewContainerDoesNotExistError(id string) error
- func NewContainerExistsError(id string) error
- func NewHresultError(hresult Hresult) error
- func NewProcessDoesNotExistError(pid int) error
- func WrapHresult(e error, hresult Hresult) error
- type Hresult
- type StackTracer
Constants ¶
const ( // HrUnexpected is the HRESULT for an unexpected exit. HrUnexpected = Hresult(-2147418113) // 0x8000FFFF // HrNotImpl is the HRESULT for a not implemented function. HrNotImpl = Hresult(-2147467263) // 0x80004001 // HrInvalidArg is the HRESULT for an invalid argument to a function. HrInvalidArg = Hresult(-2147024809) // 0x80070057 // HrPointer is the HRESULT for a nil pointer that is passed to a function. HrPointer = Hresult(-2147467261) // 0x80004003 // HrFail is the HRESULT for an invocation failure. HrFail = Hresult(-2147467259) // 0x80004005 // HrAccessDenied is the HRESULT for access denied to a resource. HrAccessDenied = Hresult(-2147024891) // 0x80070005 // HvVmcomputeTimeout is the HRESULT for operations that timed out. HvVmcomputeTimeout = Hresult(-1070137079) // 0xC0370109 // HrVmcomputeInvalidJSON is the HRESULT for failing to unmarshal a json // string. HrVmcomputeInvalidJSON = Hresult(-1070137075) // 0xC037010D // HrVmcomputeSystemAlreadyStopped is the HRESULT for calling // Shutdown/Terminate on a machine that is already in that state. HrVmcomputeSystemAlreadyStopped = Hresult(-1070137072) // 0xC0370110 // HrVmcomputeProtocolError is the HRESULT for an invalid protocol // request/response. HrVmcomputeProtocolError = Hresult(-1070137071) // 0xC0370111 // HrVmcomputeUnsupportedProtocolVersion is the HRESULT for an invalid // protocol version range specified at negotiation. HrVmcomputeUnsupportedProtocolVersion = Hresult(-1070137076) // 0xC037010C // HrVmcomputeUnknownMessage is the HRESULT for unknown message types sent // from the HCS. HrVmcomputeUnknownMessage = Hresult(-1070137077) // 0xC037010B )
Variables ¶
This section is empty.
Functions ¶
func BaseStackTrace ¶
func BaseStackTrace(e error) errors.StackTrace
BaseStackTrace gets the earliest errors.StackTrace in the given error's cause stack. This will be the stack trace which reaches closest to the error's actual origin. It returns nil if no stack trace is found in the cause stack.
func NewContainerDoesNotExistError ¶
NewContainerDoesNotExistError returns an error referring to the given ID.
func NewContainerExistsError ¶
NewContainerExistsError returns an error referring to the given ID.
func NewHresultError ¶
NewHresultError produces a new error with the given HRESULT.
func NewProcessDoesNotExistError ¶
NewProcessDoesNotExistError returns an error referring to the given pid.
func WrapHresult ¶
WrapHresult produces a new error with the given HRESULT and wrapping the given error.
Types ¶
type Hresult ¶
type Hresult int32
Hresult is a type corresponding to the HRESULT error type used on Windows.
func GetHresult ¶
GetHresult interates through the error's cause stack (similiarly to how the Cause function in github.com/pkg/errors operates). At the first error it encounters which implements the Hresult() method, it return's that error's HRESULT. This allows errors higher up in the cause stack to shadow the HRESULTs of errors lower down.
type StackTracer ¶
type StackTracer interface {
StackTrace() errors.StackTrace
}
StackTracer is an interface originating (but not exported) from the github.com/pkg/errors package. It defines something which can return a stack trace.