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")Content copied to clipboard
Return
A concrete DeepSeekException matching statusCode
Parameters
status Code
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
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
status Code
HTTP status code returned by the API
headers
Response headers snapshot
error
Parsed error payload, or null if the body could not be decoded