pub enum SpriteError {
Config {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Git {
operation: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Tmux {
operation: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Agent {
message: String,
agent_id: Option<String>,
},
Session {
message: String,
session_name: Option<String>,
},
FileSystem {
operation: String,
path: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Validation {
message: String,
field: Option<String>,
value: Option<String>,
},
Process {
command: String,
exit_code: Option<i32>,
stdout: String,
stderr: String,
},
Io {
operation: String,
source: Error,
},
Yaml {
message: String,
line: Option<usize>,
column: Option<usize>,
},
Security {
message: String,
violation_type: SecurityViolationType,
},
Communication {
message: String,
target: Option<String>,
},
}Expand description
Main error type for the Sprite application.
Variants§
Config
Configuration-related errors
Git
Git operation errors
Tmux
Tmux operation errors
Agent
Agent management errors
Session
Session management errors
FileSystem
File system errors
Validation
Validation errors
Process
Process execution errors
Io
I/O errors
Yaml
YAML parsing errors
Security
Security errors
Communication
Network/communication errors
Implementations§
Source§impl SpriteError
impl SpriteError
Sourcepub fn config_with_source(
message: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn config_with_source( message: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Create a configuration error with a message and source error.
Sourcepub fn git_with_source(
operation: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn git_with_source( operation: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Create a git operation error with a source error.
Sourcepub fn tmux_with_source(
operation: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn tmux_with_source( operation: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Create a tmux operation error with a source error.
Sourcepub fn agent(
message: impl Into<String>,
agent_id: Option<impl Into<String>>,
) -> Self
pub fn agent( message: impl Into<String>, agent_id: Option<impl Into<String>>, ) -> Self
Create an agent error.
Sourcepub fn session(
message: impl Into<String>,
session_name: Option<impl Into<String>>,
) -> Self
pub fn session( message: impl Into<String>, session_name: Option<impl Into<String>>, ) -> Self
Create a session error.
Sourcepub fn filesystem(operation: impl Into<String>, path: impl Into<String>) -> Self
pub fn filesystem(operation: impl Into<String>, path: impl Into<String>) -> Self
Create a file system error.
Sourcepub fn filesystem_with_source(
operation: impl Into<String>,
path: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn filesystem_with_source( operation: impl Into<String>, path: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Create a file system error with a source error.
Sourcepub fn validation(
message: impl Into<String>,
field: Option<impl Into<String>>,
value: Option<impl Into<String>>,
) -> Self
pub fn validation( message: impl Into<String>, field: Option<impl Into<String>>, value: Option<impl Into<String>>, ) -> Self
Create a validation error.
Sourcepub fn process(
command: impl Into<String>,
exit_code: Option<i32>,
stdout: impl Into<String>,
stderr: impl Into<String>,
) -> Self
pub fn process( command: impl Into<String>, exit_code: Option<i32>, stdout: impl Into<String>, stderr: impl Into<String>, ) -> Self
Create a process execution error.
Sourcepub fn yaml(
message: impl Into<String>,
line: Option<usize>,
column: Option<usize>,
) -> Self
pub fn yaml( message: impl Into<String>, line: Option<usize>, column: Option<usize>, ) -> Self
Create a YAML parsing error.
Sourcepub fn security(
message: impl Into<String>,
violation_type: SecurityViolationType,
) -> Self
pub fn security( message: impl Into<String>, violation_type: SecurityViolationType, ) -> Self
Create a security error.
Sourcepub fn communication(
message: impl Into<String>,
target: Option<impl Into<String>>,
) -> Self
pub fn communication( message: impl Into<String>, target: Option<impl Into<String>>, ) -> Self
Create a communication error.
Sourcepub fn config_not_found(path: impl Into<String>) -> Self
pub fn config_not_found(path: impl Into<String>) -> Self
Create a config not found error.
Sourcepub fn agent_not_found(agent_id: impl Into<String>) -> Self
pub fn agent_not_found(agent_id: impl Into<String>) -> Self
Create an agent not found error.
Sourcepub fn agent_not_active(agent_id: impl Into<String>) -> Self
pub fn agent_not_active(agent_id: impl Into<String>) -> Self
Create an agent not active error.
Sourcepub fn session_not_found(message: impl Into<String>) -> Self
pub fn session_not_found(message: impl Into<String>) -> Self
Create a session not found error.
Sourcepub fn pane_not_found(message: impl Into<String>) -> Self
pub fn pane_not_found(message: impl Into<String>) -> Self
Create a pane not found error.
Sourcepub fn suggestion(&self) -> Option<String>
pub fn suggestion(&self) -> Option<String>
Get a user-friendly suggestion for resolving this error.
Trait Implementations§
Source§impl Debug for SpriteError
impl Debug for SpriteError
Source§impl Display for SpriteError
Display implementation that includes suggestions.
impl Display for SpriteError
Display implementation that includes suggestions.
Source§impl Error for SpriteError
Implement std::error::Error trait for SpriteError.
impl Error for SpriteError
Implement std::error::Error trait for SpriteError.
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for SpriteError
Convert std::io::Error to our error type.
impl From<Error> for SpriteError
Convert std::io::Error to our error type.