errors

package
v0.26.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRetryDelay

func GetRetryDelay(errorInfo *GraphErrorInfo, attempt int) time.Duration

GetRetryDelay calculates the appropriate retry delay based on error information

func HandleGraphError

func HandleGraphError(ctx context.Context, err error, resp interface{}, operation string, requiredPermissions []string)

HandleGraphError processes Graph API errors and dispatches them appropriately

func IsNonRetryableDeleteError

func IsNonRetryableDeleteError(errorInfo *GraphErrorInfo) bool

IsNonRetryableDeleteError determines if an error should never be retried for delete operations based on the response http status code and error information

func IsNonRetryableReadError

func IsNonRetryableReadError(errorInfo *GraphErrorInfo) bool

IsNonRetryableReadError determines if an error should never be retried for read operations based on the response http status code and error information

func IsRetryableDeleteError

func IsRetryableDeleteError(errorInfo *GraphErrorInfo) bool

IsRetryableDeleteError determines if an error is retryable for delete operations based on the response http status code and error information

func IsRetryableReadError

func IsRetryableReadError(errorInfo *GraphErrorInfo) bool

IsRetryableReadError determines if an error is retryable for read operations (especially after create/update) based on the response http status code and error information

Types

type ErrorCategory

type ErrorCategory string

ErrorCategory represents different types of errors

const (
	CategoryAuthentication ErrorCategory = "authentication"
	CategoryAuthorization  ErrorCategory = "authorization"
	CategoryValidation     ErrorCategory = "validation"
	CategoryThrottling     ErrorCategory = "throttling"
	CategoryService        ErrorCategory = "service"
	CategoryNetwork        ErrorCategory = "network"
	CategoryUnknown        ErrorCategory = "unknown"
)

type ErrorDescription

type ErrorDescription struct {
	Summary string
	Detail  string
}

ErrorDescription contains standardized error messages and summaries

type ErrorDetailInfo

type ErrorDetailInfo struct {
	Code    string
	Message string
	Target  string
}

ErrorDetailInfo contains information from error details array

type GraphErrorInfo

type GraphErrorInfo struct {
	StatusCode      int
	ErrorCode       string
	ErrorMessage    string
	Target          string
	IsODataError    bool
	AdditionalData  map[string]interface{}
	Headers         *abstractions.ResponseHeaders
	RequestDetails  string
	RetryAfter      string
	RequestID       string
	ClientRequestID string
	ErrorDate       string
	InnerErrors     []InnerErrorInfo
	ErrorDetails    []ErrorDetailInfo
	CorrelationID   string
	ThrottledReason string
	Category        ErrorCategory
	DiagnosticInfo  string
}

GraphErrorInfo contains extracted information from a Graph API error

func GraphError

func GraphError(ctx context.Context, err error) GraphErrorInfo

GraphError extracts and analyzes error information from Graph API errors

type InnerErrorInfo

type InnerErrorInfo struct {
	Code        string
	Message     string
	ODataType   string
	RequestID   string
	ClientReqID string
	Date        string
	Target      string
}

InnerErrorInfo contains information from nested inner errors

Jump to

Keyboard shortcuts

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