Documentation
¶
Overview ¶
Package oautherror provides OAuth response diagnostics.
Index ¶
- type ResponseError
- func (e *ResponseError) Code() string
- func (e *ResponseError) Detail() string
- func (e *ResponseError) Diagnostic() string
- func (e *ResponseError) Error() string
- func (e *ResponseError) ErrorDescription() string
- func (e *ResponseError) Message() string
- func (e *ResponseError) OAuthError() string
- func (e *ResponseError) ResponseBody() []byte
- func (e *ResponseError) StatusCode() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseError ¶
type ResponseError struct {
// contains filtered or unexported fields
}
ResponseError preserves an upstream OAuth error response while exposing parsed fields for refresh-failure classification.
func NewResponseError ¶
func NewResponseError(statusCode int, body []byte) *ResponseError
NewResponseError extracts diagnostics from an OAuth error response.
func (*ResponseError) Code ¶
func (e *ResponseError) Code() string
Code returns the provider error code.
func (*ResponseError) Detail ¶
func (e *ResponseError) Detail() string
Detail returns the provider detail.
func (*ResponseError) Diagnostic ¶
func (e *ResponseError) Diagnostic() string
Diagnostic returns a summary assembled only from known OAuth response fields. Callers must still redact and bound field values before logging it.
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
Error returns the upstream response body unchanged.
func (*ResponseError) ErrorDescription ¶
func (e *ResponseError) ErrorDescription() string
ErrorDescription returns the OAuth error description.
func (*ResponseError) Message ¶
func (e *ResponseError) Message() string
Message returns the provider message.
func (*ResponseError) OAuthError ¶
func (e *ResponseError) OAuthError() string
OAuthError returns the OAuth error identifier.
func (*ResponseError) ResponseBody ¶
func (e *ResponseError) ResponseBody() []byte
ResponseBody returns a copy of the upstream HTTP response body.
func (*ResponseError) StatusCode ¶
func (e *ResponseError) StatusCode() int
StatusCode returns the upstream HTTP response status.