refactor: reduce map_err boilerplate with context helper methods (TODO-025)
Add per-crate variant_ctx() helper methods to StorageError, BlobCacheError, ProtocolError, and BridgeError. Replace 78 .map_err(|e| format!(...)) closures with concise context calls. Identical error messages preserved.
This commit is contained in:
@@ -98,6 +98,12 @@ pub enum BridgeError {
|
||||
Unmapped(String),
|
||||
}
|
||||
|
||||
impl BridgeError {
|
||||
fn unmapped_ctx(ctx: impl std::fmt::Display, e: impl std::fmt::Display) -> Self {
|
||||
BridgeError::Unmapped(format!("{ctx}: {e}"))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<chanora_core::CoreError> for BridgeError {
|
||||
fn from(e: chanora_core::CoreError) -> Self {
|
||||
match e {
|
||||
|
||||
Reference in New Issue
Block a user