Package-level declarations

Exception hierarchy for handling Volvo API errors with typed exceptions for rate limiting (429), authentication (401), permissions (403), invalid requests (400/404/409/415), and server errors (5xx).

Types

Link copied to clipboard
class AuthenticationException(statusCode: Int, error: VolvoApiError, throwable: Throwable? = null) : VolvoAPIException

Exception thrown when the access token is invalid or expired (HTTP 401).

Link copied to clipboard
class GenericIOException(throwable: Throwable? = null) : VolvoIOException

Exception thrown for network I/O errors other than timeouts.

Link copied to clipboard
class InvalidRequestException(statusCode: Int, error: VolvoApiError, throwable: Throwable? = null) : VolvoAPIException

Exception thrown for invalid or malformed API requests (HTTP 400, 404, 409, 415).

Link copied to clipboard
class PermissionException(statusCode: Int, error: VolvoApiError, throwable: Throwable? = null) : VolvoAPIException

Exception thrown when the API key lacks required permissions (HTTP 403).

Link copied to clipboard
class RateLimitException(statusCode: Int, error: VolvoApiError, throwable: Throwable? = null) : VolvoAPIException

Exception thrown when the API rate limit is exceeded (HTTP 429).

Link copied to clipboard
class UnknownException(statusCode: Int, error: VolvoApiError, throwable: Throwable? = null) : VolvoAPIException

Exception thrown for API errors not covered by other exception types.

Link copied to clipboard
@Serializable
data class VolvoApiError(val detail: VolvoErrorDetails? = null)

Represents an error response from the Volvo API.

Link copied to clipboard

Exception thrown when the Volvo API returns an HTTP error response.

Link copied to clipboard
@Serializable
data class VolvoErrorDetails(val code: String? = null, val message: String? = null, val param: String? = null, val type: String? = null, val line: Int? = null)

Represents an error object returned by the Volvo API.

Link copied to clipboard

Base exception for all Volvo API client errors.

Link copied to clipboard
class VolvoHttpException(throwable: Throwable? = null) : VolvoException

Exception thrown when the Ktor HTTP client encounters a runtime error.

Link copied to clipboard

Exception thrown when a network or I/O error occurs during an API request.

Link copied to clipboard
class VolvoServerException(throwable: Throwable? = null) : VolvoException

Exception thrown when the Volvo API returns a server error (HTTP 5xx).

Link copied to clipboard

Exception thrown when an HTTP request times out.