Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtimes/js: Added middleware functionality #1631

Merged
merged 9 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename
  • Loading branch information
fredr committed Jan 7, 2025
commit c1684a2877e2f89bb156b31b9185982d505c5849
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