AFException
Represents an exception that occurs during an API call.
This class is used to deserialize error responses from the API. It extends Throwable so it can be thrown and caught like a standard exception.
Constructors
Creates an AFException with the given message.
Creates an AFException that carries the underlying cause, so consumers can classify the failure (offline, timeout, TLS, decode) from the original exception instead of pattern-matching on message text.
Properties
The failure this exception wraps, from either construction path: the cause parameter of the secondary constructor, or a later initCause(...) on platforms whose Throwable offers it. A class with a primary constructor cannot delegate to super(cause), so the constructor form is carried in a field and the standard chain is read as the fallback - without it, initCause would compile, throw nothing and be silently discarded.
What kind of failure this is, classified the same way on every platform. Use it to localize or customize the copy you show; the default message is already member-safe.
A message that is safe to show the member. When the server rejected the request with its own message (HTTP 4xx), that message is carried unchanged. For system failures - no connection, timeouts, TLS, server errors, unreadable responses - it is a short, member-friendly sentence chosen by kind; the raw diagnostic text is in technicalMessage, never here.
Diagnostic text for logs and support - the underlying engine error, the HTTP status line, or a snippet of an unreadable response body. Never show it to a member: it can name hosts, URLs and internals.