Skip to content

Struct prelude::HostError

zaun_bot::prelude::HostError · Struct

pub struct HostError { … }

What the host refused, mirroring the protocol’s error codes.

FORBIDDEN, NOT_FOUND, BAD_REQUEST, RATE_LIMITED, CONFLICT, PAYLOAD_TOO_LARGE, NOT_GRANTED (a capability the bot lacks), UNSUPPORTED (this host does not implement the call or this case of it yet), …

The reason or field the host gave, if any.

For RATE_LIMITED and BUSY.

pub fn is_unsupported(&self) -> bool

Whether the host does not implement this call (or this case of it) yet: an older host, or a feature it lacks, such as volume without an Opus encoder. Fall back to what the bot did before; trying again will not help.

Clone, Debug, Display, Error

Full rustdoc page