atlas_cli/error/mod.rs
1mod types;
2
3pub use types::{Error, Result};
4
5/// Format an error for display to the user
6///
7/// # Examples
8///
9/// ```
10/// use atlas_cli::error::{Error, format_error};
11///
12/// let error = Error::Validation("Invalid input".to_string());
13/// let formatted = format_error(&error);
14/// assert_eq!(formatted, "Validation error: Invalid input");
15///
16/// let io_error = Error::Storage("Connection failed".to_string());
17/// let formatted = format_error(&io_error);
18/// assert_eq!(formatted, "Storage error: Connection failed");
19/// ```
20pub fn format_error(error: &Error) -> String {
21 error.to_string()
22}