Skip to main content

webui/
error.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT license.
3
4//! Error types for the WebUI library.
5
6use thiserror::Error;
7
8/// Errors that can occur during WebUI build, render, or inspection operations.
9#[derive(Debug, Error)]
10pub enum WebUIError {
11    /// I/O error (file read/write failures).
12    #[error("I/O error: {0}")]
13    Io(String),
14
15    /// Component registration failure.
16    #[error("Component registration error: {0}")]
17    ComponentRegistration(String),
18
19    /// Component discovery failure (npm packages or local paths).
20    #[error("Component discovery error: {0}")]
21    ComponentDiscovery(String),
22
23    /// HTML/CSS parsing failure.
24    #[error("Parse error: {0}")]
25    Parse(String),
26
27    /// Protocol serialization or deserialization failure.
28    #[error("Protocol error: {0}")]
29    Protocol(String),
30
31    /// JSON serialization failure.
32    #[error("Serialization error: {0}")]
33    Serialization(String),
34
35    /// Handler rendering error.
36    #[error("Rendering error: {0}")]
37    Rendering(String),
38}