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 ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { StatusCode int // HTTP status code Type string // A brief identifier for the type of error Message string // Human-readable message Detail string // Detailed error message Errors map[string]interface{} // A map to hold various error fields Raw string // Raw response body for unstructured errors }
APIError represents a more flexible structure for API error responses.
func HandleAPIErrorResponse ¶
HandleAPIErrorResponse attempts to parse the error response from the API and logs using the zap logger.
type StructuredError ¶
type StructuredError struct { Error struct { Code string `json:"code"` Message string `json:"message"` } `json:"error"` }
StructuredError represents a structured error response from the API.
Click to show internal directories.
Click to hide internal directories.