Documentation ¶
Overview ¶
response/error.go This package provides utility functions and structures for handling and categorizing HTTP error responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct { StatusCode int `json:"status_code" xml:"StatusCode"` // HTTP status code Type string `json:"type" xml:"Type"` // Type of error Message string `json:"message" xml:"Message"` // Human-readable message Detail string `json:"detail,omitempty" xml:"Detail,omitempty"` // Detailed error message Errors map[string]interface{} `json:"errors,omitempty" xml:"Errors,omitempty"` // Additional error details Raw string `json:"raw" xml:"Raw"` // Raw response body for debugging }
APIError represents an api error response.
func HandleAPIErrorResponse ¶
HandleAPIErrorResponse handles the HTTP error response from an API and logs the error.
Click to show internal directories.
Click to hide internal directories.