fromCode

fun fromCode(message: String?, code: Int?): NetworkError

Creates the appropriate NetworkError subclass from the given error code and message.

Return

The typed NetworkError matching the code.

Parameters

message

The error message, or null to use a default message.

code

The HTTP status code, or null to return a GeneralError.