APIError represents a custom error structure for the API. It includes an error code, message, and optional details to provide additional context for the error.
| 39 | // APIError represents a custom error structure for the API. |
| 40 | // It includes an error code, message, and optional details to provide additional context for the error. |
| 41 | type APIError struct { |
| 42 | Code ErrorCode `json:"code"` // The specific error code that identifies the type of error. |
| 43 | Message string `json:"message"` // A human-readable message that describes the error. |
| 44 | Details interface{} `json:"details,omitempty"` // Optional field for additional details or context about the error. |
| 45 | } |
| 46 | |
| 47 | // Error implements the error interface for APIError. |
| 48 | // It returns a formatted string combining the error code and message. |
nothing calls this directly
no outgoing calls
no test coverage detected