package runtime

import "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime"

Index

Functions

func NewFrameError

func NewFrameError(inner error, stackTrace bool, skipFrames, totalFrames int) error

NewFrameError wraps the specified error with an error that provides stack frame information. Call this at the inner error's origin to provide file name and line number info with the error. You MUST supply an inner error. DO NOT ARBITRARILY CALL THIS TO WRAP ERRORS! There MUST be only ONE error of this type in the chain.

func NewResponseError

func NewResponseError(inner error, resp *http.Response) error

NewResponseError wraps the specified error with an error that provides access to an HTTP response. If an HTTP request fails, wrap the response and the associated error in this error type so that callers can access the underlying *http.Response as required. You MUST supply an inner error.

func StackTrace

func StackTrace(skipFrames, totalFrames int) string

StackTrace returns a formatted stack trace string. skipFrames - the number of stack frames to skip before composing the trace string. totalFrames - the maximum number of stack frames to include in the trace string.

Types

type FrameError

type FrameError struct {
	// contains filtered or unexported fields
}

FrameError associates an error with stack frame information. Exported for testing purposes, use NewFrameError().

func (*FrameError) Error

func (f *FrameError) Error() string

Error implements the error interface for type FrameError.

func (*FrameError) Unwrap

func (f *FrameError) Unwrap() error

Unwrap returns the inner error.

type ResponseError

type ResponseError struct {
	// contains filtered or unexported fields
}

ResponseError associates an error with an HTTP response. Exported for type assertion purposes in azcore, use NewResponseError().

func (*ResponseError) Error

func (e *ResponseError) Error() string

Error implements the error interface for type ResponseError.

func (*ResponseError) RawResponse

func (e *ResponseError) RawResponse() *http.Response

RawResponse returns the HTTP response associated with this error.

func (*ResponseError) Unwrap

func (e *ResponseError) Unwrap() error

Unwrap returns the inner error.

Source Files

frame_error.go response_error.go runtime.go

Version
v0.5.0
Published
Oct 13, 2020
Platform
windows/amd64
Imports
4 packages
Last checked
9 minutes ago

Tools for package owners.