from

fun from(statusCode: Int, headers: DeepSeekHeaders, error: DeepSeekError?, message: String): DeepSeekException

Creates the matching DeepSeekException subtype for statusCode.

Example:

throw DeepSeekException.from(response.status.value, headers, error, "custom message")

Return

A concrete DeepSeekException matching statusCode

Parameters

statusCode

HTTP status code returned by the API

headers

Response headers snapshot

error

Parsed error payload, or null if the body could not be decoded

message

Human-readable message attached to the exception


fun from(statusCode: Int, headers: DeepSeekHeaders, error: DeepSeekError?): DeepSeekException

Creates the matching DeepSeekException subtype for statusCode, using a built-in default message that hints at the likely cause and the remediation step.

Return

A concrete DeepSeekException matching statusCode

Parameters

statusCode

HTTP status code returned by the API

headers

Response headers snapshot

error

Parsed error payload, or null if the body could not be decoded