Error implements the error interface for APIError. It returns a formatted string combining the error code and message.
()
| 47 | // Error implements the error interface for APIError. |
| 48 | // It returns a formatted string combining the error code and message. |
| 49 | func (e APIError) Error() string { |
| 50 | return fmt.Sprintf("%s: %s", e.Code, e.Message) |
| 51 | } |
| 52 | |
| 53 | // NewAPIError creates a new APIError instance. |
| 54 | // It logs the error details and returns the error object with the provided code, message, and additional details. |
no outgoing calls