Skip to content

Commit

Permalink
remove anyhow dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
oac1771 committed Dec 8, 2024
1 parent dffb647 commit 667b3ea
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions crates/clis/requester/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@ pub enum Error {

#[error("")]
NetworkHandlerStopped,

#[error(transparent)]
Unknown(#[from] anyhow::Error),
}
3 changes: 0 additions & 3 deletions crates/clis/worker/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,4 @@ pub enum Error {

#[error("")]
WorkerStoppedUnexpectedly,

#[error(transparent)]
Unknown(#[from] anyhow::Error),
}
1 change: 0 additions & 1 deletion crates/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ wasmtime = { workspace = true }
pallet-contracts = { workspace = true, default-features = false }
sp-runtime = { workspace = true, default-features = false }
sp-weights = { workspace = true, default-features = false }
anyhow = { workspace = true}

catalog = { workspace = true }
async-stream = "0.3.6"
Expand Down
10 changes: 7 additions & 3 deletions crates/utils/src/services/job/job_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ impl WasmJobRunner {
params: Vec<Val>,
mut results: Vec<Val>,
store: Store<()>,
) -> Result<JoinHandle<anyhow::Result<RawResults>>, Error> {
let job_handle: JoinHandle<anyhow::Result<RawResults>> = tokio::spawn(async move {
func.call(store, &params, &mut results)?;
) -> Result<JoinHandle<Result<RawResults, Error>>, Error> {
let job_handle: JoinHandle<Result<RawResults, Error>> = tokio::spawn(async move {
func.call(store, &params, &mut results)
.map_err(|e| Error::JobError { err: e.to_string() })?;
let result = results
.iter()
.map(|v| match v {
Expand Down Expand Up @@ -223,6 +224,9 @@ pub enum Error {
source: codec::Error,
},

#[error("{err}")]
JobError { err: String },

#[error("")]
FuncTypeNotFound,

Expand Down

0 comments on commit 667b3ea

Please sign in to comment.