func IsAccessIsDenied(err error) bool {
	err = getInnerError(err)
	return err == ErrVmcomputeOperationAccessIsDenied
}
IsAccessIsDenied returns true when err is caused by
`ErrVmcomputeOperationAccessIsDenied`.
package hcs
import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"net"
	"syscall"
	"github.com/Microsoft/hcsshim/internal/log"
)
var (
	ErrComputeSystemDoesNotExist = syscall.Errno(0xc037010e)
	ErrElementNotFound = syscall.Errno(0x490)
	ErrNotSupported = syscall.Errno(0x32)
	ErrInvalidData = syscall.Errno(0xd)
	ErrHandleClose = errors.New("hcsshim: the handle generating this notification has been closed")
	ErrAlreadyClosed = errors.New("hcsshim: the handle has already been closed")
	ErrInvalidNotificationType = errors.New("hcsshim: invalid notification type")
	ErrInvalidProcessState = errors.New("the process is in an invalid state for the attempted operation")
	ErrTimeout = errors.New("hcsshim: timeout waiting for notification")
	ErrUnexpectedContainerExit = errors.New("unexpected container exit")
	ErrUnexpectedProcessAbort = errors.New("lost communication with compute service")
	ErrUnexpectedValue = errors.New("unexpected value returned from hcs")
	ErrVmcomputeAlreadyStopped = syscall.Errno(0xc0370110)
	ErrVmcomputeOperationPending = syscall.Errno(0xC0370103)
	ErrVmcomputeOperationInvalidState = syscall.Errno(0xc0370105)
	ErrProcNotFound = syscall.Errno(0x7f)
	ErrVmcomputeOperationAccessIsDenied = syscall.Errno(0x5)
	ErrVmcomputeInvalidJSON = syscall.Errno(0xc037010d)
	ErrVmcomputeUnknownMessage = syscall.Errno(0xc037010b)
	ErrVmcomputeUnexpectedExit = syscall.Errno(0xC0370106)
	ErrPlatformNotSupported = errors.New("unsupported platform request")
)
type ErrorEvent struct {
	Message    string `json:"Message,omitempty"`     
	StackTrace string `json:"StackTrace,omitempty"`  
	Provider   string `json:"Provider,omitempty"`
	EventID    uint16 `json:"EventId,omitempty"`
	Flags      uint32 `json:"Flags,omitempty"`
	Source     string `json:"Source,omitempty"`
}
type hcsResult struct {
	Error        int32
	ErrorMessage string
	ErrorEvents  []ErrorEvent `json:"ErrorEvents,omitempty"`
}
func (ev *ErrorEvent) String() string {
	evs := "[Event Detail: " + ev.Message
	if ev.StackTrace != "" {
		evs += " Stack Trace: " + ev.StackTrace
	}
	if ev.Provider != "" {
		evs += " Provider: " + ev.Provider
	}
	if ev.EventID != 0 {
		evs = fmt.Sprintf("%s EventID: %d", evs, ev.EventID)
	}
	if ev.Flags != 0 {
		evs = fmt.Sprintf("%s flags: %d", evs, ev.Flags)
	}
	if ev.Source != "" {
		evs += " Source: " + ev.Source
	}
	evs += "]"
	return evs
}
func processHcsResult(ctx context.Context, resultJSON string) []ErrorEvent {
	if resultJSON != "" {
		result := &hcsResult{}
		if err := json.Unmarshal([]byte(resultJSON), result); err != nil {
			log.G(ctx).WithError(err).Warning("Could not unmarshal HCS result")
			return nil
		}
		return result.ErrorEvents
	}
	return nil
}
type HcsError struct {
	Op     string
	Err    error
	Events []ErrorEvent
}
var _ net.Error = &HcsError{}
func (e *HcsError) Error() string {
	s := e.Op + ": " + e.Err.Error()
	for _, ev := range e.Events {
		s += "\n" + ev.String()
	}
	return s
}
func (e *HcsError) Temporary() bool {
	err, ok := e.Err.(net.Error)
	return ok && err.Temporary()
}
func (e *HcsError) Timeout() bool {
	err, ok := e.Err.(net.Error)
	return ok && err.Timeout()
}
type ProcessError struct {
	SystemID string
	Pid      int
	Op       string
	Err      error
	Events   []ErrorEvent
}
var _ net.Error = &ProcessError{}
type SystemError struct {
	ID     string
	Op     string
	Err    error
	Events []ErrorEvent
}
var _ net.Error = &SystemError{}
func (e *SystemError) Error() string {
	s := e.Op + " " + e.ID + ": " + e.Err.Error()
	for _, ev := range e.Events {
		s += "\n" + ev.String()
	}
	return s
}
func (e *SystemError) Temporary() bool {
	err, ok := e.Err.(net.Error)
	return ok && err.Temporary()
}
func (e *SystemError) Timeout() bool {
	err, ok := e.Err.(net.Error)
	return ok && err.Timeout()
}
func makeSystemError(system *System, op string, err error, events []ErrorEvent) error {
	if _, ok := err.(*SystemError); ok {
		return err
	}
	return &SystemError{
		ID:     system.ID(),
		Op:     op,
		Err:    err,
		Events: events,
	}
}
func (e *ProcessError) Error() string {
	s := fmt.Sprintf("%s %s:%d: %s", e.Op, e.SystemID, e.Pid, e.Err.Error())
	for _, ev := range e.Events {
		s += "\n" + ev.String()
	}
	return s
}
func (e *ProcessError) Temporary() bool {
	err, ok := e.Err.(net.Error)
	return ok && err.Temporary()
}
func (e *ProcessError) Timeout() bool {
	err, ok := e.Err.(net.Error)
	return ok && err.Timeout()
}
func makeProcessError(process *Process, op string, err error, events []ErrorEvent) error {
	if _, ok := err.(*ProcessError); ok {
		return err
	}
	return &ProcessError{
		Pid:      process.Pid(),
		SystemID: process.SystemID(),
		Op:       op,
		Err:      err,
		Events:   events,
	}
}
func IsNotExist(err error) bool {
	err = getInnerError(err)
	return err == ErrComputeSystemDoesNotExist ||
		err == ErrElementNotFound
}
func IsAlreadyClosed(err error) bool {
	err = getInnerError(err)
	return err == ErrAlreadyClosed
}
func IsPending(err error) bool {
	err = getInnerError(err)
	return err == ErrVmcomputeOperationPending
}
func IsTimeout(err error) bool {
	if err, ok := err.(net.Error); ok && err.Timeout() {
		return true
	}
	err = getInnerError(err)
	return err == ErrTimeout
}
func IsAlreadyStopped(err error) bool {
	err = getInnerError(err)
	return err == ErrVmcomputeAlreadyStopped ||
		err == ErrElementNotFound
}
func IsNotSupported(err error) bool {
	err = getInnerError(err)
	return err == ErrVmcomputeInvalidJSON ||
		err == ErrInvalidData ||
		err == ErrNotSupported ||
		err == ErrVmcomputeUnknownMessage
}
func IsOperationInvalidState(err error) bool {
	err = getInnerError(err)
	return err == ErrVmcomputeOperationInvalidState
}