arcella_types/
error.rs

1// arcella/arcella-types/src/error.rs
2//
3// Copyright (c) 2025 Alexey Rybakov, Arcella Team
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE>
6// or the MIT license <LICENSE-MIT>, at your option.
7// This file may not be copied, modified, or distributed
8// except according to those terms.
9
10use thiserror::Error;
11
12#[derive(Error, Debug, Clone, PartialEq, Eq)]
13pub enum ArcellaError {
14    
15    /// Invalid or missing module manifest.
16    #[error("Manifest error: {0}")]
17    Manifest(String),
18
19    /// Invalid module ID format.
20    #[error("Invalid module ID format: {0}")]
21    InvalidModuleIdFormat(String),
22
23    /// Invalid module ID namespace.
24    #[error("Invalid module ID name: {0}")]
25    InvalidModuleIdName(String),
26
27    /// Invalid module ID version.
28    #[error("Invalid module ID version: {0}")]
29    InvalidModuleIdVersion(String),
30
31}
32
33/// Result type alias for `arcella-wasmtime` operations.
34pub type ArcellaResult<T> = std::result::Result<T, ArcellaError>;