wasmrs_host/
errors.rs

1//! Library-specific error types and utility functions
2
3type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;
4
5/// Error type for wasmRS errors.
6#[derive(Debug, thiserror::Error)]
7pub enum Error {
8  /// Initialization Failed.
9  #[error(transparent)]
10  InitFailed(BoxError),
11
12  /// Creating a new context failed.
13  #[error("Could not create new context: {0}")]
14  NewContext(String),
15
16  /// Sending a frame failed.
17  #[error("Could not send frame: {0}")]
18  SendFailed(String),
19
20  /// Guest send response to a stream that doesn't exist.
21  #[error(transparent)]
22  RSocket(#[from] wasmrs::Error),
23
24  /// Guest send response to a stream that doesn't exist.
25  #[error(transparent)]
26  PayloadError(#[from] wasmrs_frames::PayloadError),
27
28  /// Querying Operation List failed.
29  #[error("Failed to query or decode operation list")]
30  OpList(String),
31
32  /// Could not find specified operation.
33  #[error("Could not find operation {0}::{1}")]
34  OpMissing(String, String),
35}