NtsError class sealed

Failure surface for ntsQuery and ntsWarmCookies.

Sealed: every concrete instance is one of the eight variants declared below, and exhaustive switch (err) { ... } on an NtsError value is checked at compile time. Implements Exception so try { ... } on NtsError catch (err) and try { ... } on Exception catch (err) both bind it.

Implemented types
Implementers

Constructors

NtsError.authentication({required String message, TrustBackend? trustBackend})
AEAD seal/open failed (tag mismatch, malformed input).
const
factory
NtsError.internal({required String message})
Bug guard for unreachable internal states.
const
factory
NtsError.invalidSpec({required String message})
spec was rejected before any I/O happened.
const
factory
NtsError.keProtocol({required String message, TrustBackend? trustBackend})
TLS handshake or NTS-KE record exchange failed. See NtsError.network for trustBackend semantics.
const
factory
NtsError.network({required String message, TrustBackend? trustBackend})
TCP/UDP I/O error or connection failure. trustBackend carries the per-handshake trust-anchor backend resolved before the failure fired (when the failure happened post-build_tls_config), or null when the failure pre-dated config construction.
const
factory
NtsError.noCookies({TrustBackend? trustBackend})
Cookie jar empty after a handshake (server delivered none). Always post-handshake, so trustBackend is populated when the caller cares to inspect which backend authenticated the chain that produced the empty pool.
const
factory
NtsError.ntpProtocol({required String message, TrustBackend? trustBackend})
NTPv4 packet parsing or extension validation failed. See NtsError.network for trustBackend semantics.
const
factory
NtsError.timeout({required TimeoutPhase phase, TrustBackend? trustBackend})
Wall-clock budget elapsed inside one of the call's pre-NTP or NTP phases. The TimeoutPhase payload identifies which phase tripped the deadline so callers can choose the right remediation.
const
factory
NtsError.trustBackendUnavailable({required String message})
Caller selected TrustMode.platformOnly and the platform trust-anchor backend could not be constructed. Surfaced instead of silently downgrading to the webpki-roots static bundle. The payload carries the underlying construction-failure diagnostic. New in 3.0.0; consumers using exhaustive switch (err) { ... } on NtsError must add an arm for this variant.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited