caps/errors.rs
1//! Error handling.
2
3use thiserror::Error;
4
5/// Library errors.
6#[derive(Error, Debug)]
7#[error("caps error: {0}")]
8pub struct CapsError(pub(crate) String);
9
10impl From<&str> for CapsError {
11 fn from(arg: &str) -> Self {
12 Self(arg.to_string())
13 }
14}
15
16impl From<String> for CapsError {
17 fn from(arg: String) -> Self {
18 Self(arg)
19 }
20}