tadpole/error/render

Error rendering: typed errors in, human-readable messages out. Severity decides how much personality the message gets — auth failures get none, ordinary hiccups get one friendly line.

The severity ladder

Every variant maps to one of four severities in severity_of, and the severity picks the voice: the more severe the failure, the quieter the whimsy, and every rendered body ends with concrete next steps where any exist.

Variant(s)Severity
GatewayConnectFailed, HeartbeatAckMissed, HeartbeatTimeout, RateLimited, UnknownEventLight — one friendly line; these self-correct
ShardingNotSupported, GatewayClosedUnexpectedly (unresumable), ResumeFailed, RestStatus, DecodeFailedActionable — notes plus a straight Try: list
GatewayClosedUnexpectedly (unresumable → Severe), MissingToken, InvalidTokenFormat, IntentsNotPrivileged, IdentifyFailedSevere — zero whimsy, do-this-now steps
InternalContractViolationInternal — tadpole’s bug: apology and a report request

(GatewayClosedUnexpectedly is the one variant that straddles: it is Actionable when the session can resume, Severe when it cannot.) The token is redacted in every rendered string, and tests assert a planted full token never appears.

See also

Types

pub type Severity {
  Light
  Actionable
  Severe
  Internal
}

Constructors

  • Light
  • Actionable
  • Severe
  • Internal

Values

pub fn render_error(error: error.TadpoleError) -> String
pub fn severity_of(error: error.TadpoleError) -> Severity
Search Document