Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion rust/codelist-builder-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ description = "Builder library for medical codelists"
[dependencies]
codelist-rs = { path = "../codelist-rs" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = { version = "2.0.9" }
thiserror-ext = { version = "0.2.1" }
reqwest = { version = "0.12.2" }
csv = { version = "1.3.1" }
async-trait = "0.1"


[dev-dependencies]
tokio = { version = "1.0", features = ["full"] }
wiremock = { version = "0.6.4" }
21 changes: 21 additions & 0 deletions rust/codelist-builder-rs/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//! This file contains custom errors for the codelist-builder library

/// Enum to represent the different types of errors that can occur in the
/// codelist-builder library

#[derive(Debug, thiserror::Error, thiserror_ext::Construct)]
pub enum CodeListBuilderError {
#[error("Invalid usage year: {name}")]
InvalidUsageYear { name: String },

#[error("Invalid usage data: {name}")]
InvalidUsageData { name: String },

#[error("HTTP request error: {0}")]
#[construct(skip)]
ReqwestError(#[from] reqwest::Error),

#[error("CSV error: {0}")]
#[construct(skip)]
CSVError(#[from] csv::Error),
}
3 changes: 3 additions & 0 deletions rust/codelist-builder-rs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod errors;
pub mod snomed_usage_data;
pub mod usage_year;
Loading
Loading