Documentation ¶
Index ¶
- func AddDownstreamErrorToResponse(refID string, response *backend.QueryDataResponse, err error) *backend.QueryDataResponse
- func AddErrorToResponse(refID string, response *backend.QueryDataResponse, err error) *backend.QueryDataResponse
- func AddPluginErrorToResponse(refID string, response *backend.QueryDataResponse, err error) *backend.QueryDataResponse
- func DownstreamError(err error, override bool) error
- func FromStatus(status backend.Status) backend.ErrorSource
- func Middleware(plugin string) httpclient.Middleware
- func PluginError(err error, override bool) error
- func Response(err error) backend.DataResponse
- func RoundTripper(_ httpclient.Options, next http.RoundTripper) http.RoundTripper
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDownstreamErrorToResponse ¶ added in v0.188.4
func AddDownstreamErrorToResponse(refID string, response *backend.QueryDataResponse, err error) *backend.QueryDataResponse
AddDownstreamErrorToResponse adds the error as downstream source to the response if the error already has a source, the existing source will be used
func AddErrorToResponse ¶ added in v0.188.4
func AddErrorToResponse(refID string, response *backend.QueryDataResponse, err error) *backend.QueryDataResponse
AddErrorToResponse adds the error to the response
func AddPluginErrorToResponse ¶ added in v0.188.4
func AddPluginErrorToResponse(refID string, response *backend.QueryDataResponse, err error) *backend.QueryDataResponse
AddPluginErrorToResponse adds the error as plugin error source to the response if the error already has a source, the existing source will be used
func DownstreamError ¶ added in v0.181.0
DownstreamError will apply the source as downstream
func FromStatus ¶ added in v0.188.0
func FromStatus(status backend.Status) backend.ErrorSource
FromStatus returns error source from status
func Middleware ¶
func Middleware(plugin string) httpclient.Middleware
Middleware captures error source metric
func PluginError ¶ added in v0.181.0
PluginError will apply the source as plugin
func Response ¶ added in v0.188.0
func Response(err error) backend.DataResponse
Response returns an error DataResponse given status, source of the error and message.
func RoundTripper ¶ added in v0.188.4
func RoundTripper(_ httpclient.Options, next http.RoundTripper) http.RoundTripper
RoundTripper returns the error source
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error captures error source and implements the error interface
func SourceError ¶ added in v0.181.0
func SourceError(source backend.ErrorSource, err error, override bool) Error
SourceError returns an error with the source If source is already defined, it will return it, or you can override