PeerProblem

class PeerProblem(val status: Int, val code: String?, val detail: String?, val result: CommandResult?, val retry: RetryAdvice, val retryAfter: Duration?, val version: Int? = null, val cause: Throwable? = null, val title: String? = null, val violations: List<Violation> = emptyList(), val extensions: Map<String, Any?> = emptyMap())

A problem a peer answered with (RFC 9457): its HTTP status, its Wow code (none for one that is only HTTP's, or a body that is no problem, such as a proxy's), its detail, the command's result when it had a ref, what a retry may do and after how long (retryAfter, its Retry-After), and the aggregate's version it answered: a rejection's, or the current one a state read of a minimum version was answered with (wow.query.min-version-not-reached). A failure the client's transport met itself (no node reached, a connection lost) is one too, of a catalog code, with that failure as its cause.

Constructors

Link copied to clipboard
constructor(status: Int, code: String?, detail: String?, result: CommandResult?, retry: RetryAdvice, retryAfter: Duration?, version: Int? = null, cause: Throwable? = null, title: String? = null, violations: List<Violation> = emptyList(), extensions: Map<String, Any?> = emptyMap())

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
val code: String?
Link copied to clipboard
Link copied to clipboard

The problem's other members, those RFC 9457 and Wow do not name, each by its name.

Link copied to clipboard

Whether the node refused the request before handling it, so another node of the peer may take it: a 503 carrying Wow's own code of a node that is shutting down, starting, or on standby. A bare 503, or a gateway's, is no proof that nothing ran.

Link copied to clipboard
Link copied to clipboard

Whether the client sends a command answered so again itself, with its request id: never a 504, nor a gateway's bare 502 (fromGateway). A wait that timed out (wow.wait.timeout) keeps its retry, which tells the caller that sending the command again with the same request id is safe; whether it committed is unknown, so the caller decides, not the client.

Link copied to clipboard

Whether a query answered so is run again: a retry may get past it, a query repeating nothing; but a state read below its minimum version, which the peer already waited for, is the caller's to wait for again (me.ahoo.wow.api.read.MinVersionNotReachedException); and so is a gateway's bare 502 or 504 (fromGateway): a query that outran the gateway would run as long again.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Int
Link copied to clipboard

The problem's title; null when it has none.

Link copied to clipboard
val version: Int?
Link copied to clipboard

The problem's violations: the fields a request broke.

Functions

Link copied to clipboard

The exception of this problem for what was asked: a CommandRejectedException for a command's rejection, else a WowProblemException with its violations.