Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserFriendlyError ¶
UserFriendlyError converts API errors to user-friendly messages
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
Code string `json:"code,omitempty"` // Backend error code (ACCESS_DENIED, NOT_FOUND, etc.)
ErrorMessage string `json:"error,omitempty"` // Legacy error field
Message string `json:"message,omitempty"` // Detailed error message
Details string `json:"details,omitempty"`
}
APIError represents an error response from the API
func ParseAPIError ¶
ParseAPIError extracts error details from an HTTP response. NOTE: This function does NOT close resp.Body - caller is responsible for closing. This allows the caller to use defer resp.Body.Close() consistently.
Click to show internal directories.
Click to hide internal directories.