You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, as I've seen here Error now is anyhow::Error.
As description at crates.io of it suggest:
This library provides anyhow::Error, a trait object based error type for easy idiomatic error handling in Rust applications.
Generally it is nice to use it for applications in order to merge all errors into 1 Error type and have good way to have context of some errors, but it is not great for libraries.
As a solution it's better just to use an enum or just struct(String). That will give some context of Error to caller. As an example from here:
/// Error which happened in cuda runtime/// Todo: make it as enum
#[derive(Debug,Error,Clone)pubstructCudaError(String);/// Error which occured during inference
#[derive(Debug,Error,Clone)pubstructInferenceError(pubCudaError);implFrom<CudaError> forInferenceError{fn from(e:CudaError) -> Self{Self(e)}}implContext{pubfn execute<D1:Dimension,D2:Dimension>(&self,
input_data:ExecuteInput<D1>,mut output_data:Vec<ExecuteInput<D2>>,) -> Result<(),InferenceError>;}
The text was updated successfully, but these errors were encountered:
Hello, as I've seen here Error now is
anyhow::Error
.As description at crates.io of it suggest:
Generally it is nice to use it for applications in order to merge all errors into 1 Error type and have good way to have context of some errors, but it is not great for libraries.
As a solution it's better just to use an enum or just struct(String). That will give some context of Error to caller. As an example from here:
The text was updated successfully, but these errors were encountered: