Skip to main content

shelly/
error.rs

1use thiserror::Error;
2
3/// Convenient result type used by the Shelly runtime.
4pub type LiveResult<T = ()> = Result<T, ShellyError>;
5
6/// Errors returned by the Shelly core runtime.
7#[derive(Debug, Error, PartialEq, Eq)]
8pub enum ShellyError {
9    /// A received client message did not match the expected protocol shape.
10    #[error("invalid client message: {0}")]
11    InvalidMessage(String),
12
13    /// A LiveView returned a rendering error.
14    #[error("render error: {0}")]
15    Render(String),
16
17    /// A LiveView failed while handling an event.
18    #[error("event error: {0}")]
19    Event(String),
20}