gcserr

package
v0.12.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HrNotImpl is the HRESULT for a not implemented function.
	HrNotImpl = Hresult(-2147467263) // 0x80004001
	// HrFail is the HRESULT for an invocation or unspecified failure.
	HrFail = Hresult(-2147467259) // 0x80004005
	// HrErrNotFound is the HRESULT for an invalid process id.
	HrErrNotFound = Hresult(-2147023728) // 0x80070490
	// HrErrInvalidArg is the HRESULT for One or more arguments are invalid.
	HrErrInvalidArg = Hresult(-2147024809) // 0x80070057
	// 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
	// HrVmcomputeSystemNotFound is the HRESULT for:
	//
	// A virtual machine or container with the specified identifier does not
	// exist.
	HrVmcomputeSystemNotFound = Hresult(-1070137074) // 0xC037010E
	// HrVmcomputeSystemAlreadyExists is the HRESULT for:
	//
	// A virtual machine or container with the specified identifier already exists.
	HrVmcomputeSystemAlreadyExists = Hresult(-1070137073) // 0xC037010F
	// 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
	// HrVmcomputeInvalidState is the HRESULT for:
	//
	// The requested virtual machine or container operation is not valid in the
	// current state
	HrVmcomputeInvalidState = Hresult(-2143878907) // 0x80370105
	// HrVmcomputeSystemAlreadyStopped is the HRESULT for:
	//
	// The virtual machine or container with the specified identifier is not
	// running
	HrVmcomputeSystemAlreadyStopped = Hresult(-2143878896) // 0x80370110
)

from - https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/705fb797-2175-4a90-b5a3-3918024b10b8 - https://docs.microsoft.com/en-us/virtualization/api/hcs/reference/hcshresult

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 NewHresultError

func NewHresultError(hresult Hresult) error

NewHresultError produces a new error with the given HRESULT.

func WrapHresult

func WrapHresult(e error, hresult Hresult) error

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

func GetHresult(e error) (Hresult, error)

GetHresult iterates through the error's cause stack (similar 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL