Skip to content

Commit

Permalink
refactor: define a separate crate data-error to handle errors
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Feb 28, 2024
1 parent fcc4a6c commit b9bab07
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"data-error",
"data-pdf",
"data-resource",
"fs-atomic-versions",
Expand All @@ -8,6 +9,7 @@ members = [
]

default-members = [
"data-error",
"data-pdf",
"data-resource",
"fs-atomic-versions",
Expand Down
11 changes: 11 additions & 0 deletions data-error/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "data-error"
version = "0.1.0"
edition = "2021"

[dependencies]
thiserror = "1"
reqwest = "0.11.11"
serde_json = "1.0.82"
anyhow = "1"
url = { version = "2.2.2", features = ["serde"] }
1 change: 0 additions & 1 deletion fs-utils/src/errors.rs → data-error/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::str::Utf8Error;

use thiserror::Error;

pub type Result<T> = std::result::Result<T, ArklibError>;
Expand Down
2 changes: 2 additions & 0 deletions fs-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ edition = "2021"


[dependencies]
data-error = { path = "../data-error" }

thiserror = "1"
reqwest = "0.11.11"
serde_json = "1.0.82"
Expand Down
2 changes: 1 addition & 1 deletion fs-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pub mod errors;
pub use data_error as errors;
pub mod json;

0 comments on commit b9bab07

Please sign in to comment.