Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
fredr committed Dec 6, 2024
1 parent 7b61167 commit 04dd70c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtimes/js/src/request_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ use crate::pvalue::PVals;

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("invalid json")]
#[error("failed serializing json")]
SerializeJson(#[from] serde_json::Error),
#[error("mutex poisoned")]
MutexPoisoned,
MutexPoison,
}

impl<T> From<std::sync::PoisonError<T>> for Error {
fn from(_value: std::sync::PoisonError<T>) -> Self {
Self::MutexPoisoned
Self::MutexPoison
}
}

impl From<Error> for napi::Error {
fn from(err: Error) -> Self {
match err {
Error::SerializeJson(error) => napi::Error::from(error),
Error::MutexPoisoned => napi::Error::from(err),
Error::MutexPoison => napi::Error::from(err),
}
}
}
Expand Down

0 comments on commit 04dd70c

Please sign in to comment.