Replace Codex errors at bridge boundary
This commit is contained in:
parent
d749c50f2d
commit
b54db5b54c
8 changed files with 84 additions and 60 deletions
20
epiphany-codex-bridge/src/error.rs
Normal file
20
epiphany-codex-bridge/src/error.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use std::error::Error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum EpiphanyBridgeError {
|
||||
InvalidRequest(String),
|
||||
Fatal(String),
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, EpiphanyBridgeError>;
|
||||
|
||||
impl fmt::Display for EpiphanyBridgeError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::InvalidRequest(message) | Self::Fatal(message) => f.write_str(message),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for EpiphanyBridgeError {}
|
||||
Reference in a new issue