* Generic interface for representing an API error structure. * * @template T - Optional type of additional data returned with the error.
| 4 | * @template T - Optional type of additional data returned with the error. |
| 5 | */ |
| 6 | interface IAPIError<T = unknown> { |
| 7 | /** HTTP status code or API-defined error code */ |
| 8 | status: number; |
| 9 | /** Optional list of error causes (e.g., validation issues) */ |
| 10 | cause?: string[]; |
| 11 | /** Optional extra data provided with the error */ |
| 12 | data?: T; |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Custom error class for representing API errors. |
nothing calls this directly
no outgoing calls
no test coverage detected