Skip to content

Commit 70dfb3b

Browse files
committed
trustpub: Implement BoxedAppError conversion for validation errors
1 parent eb03952 commit 70dfb3b

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ crates_io_pagerduty = { path = "crates/crates_io_pagerduty" }
7474
crates_io_session = { path = "crates/crates_io_session" }
7575
crates_io_tarball = { path = "crates/crates_io_tarball" }
7676
crates_io_team_repo = { path = "crates/crates_io_team_repo" }
77+
crates_io_trustpub = { path = "crates/crates_io_trustpub" }
7778
crates_io_worker = { path = "crates/crates_io_worker" }
7879
csv = "=1.3.1"
7980
chrono = { version = "=0.4.41", default-features = false, features = ["serde"] }

src/util/errors.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ impl From<GitHubError> for BoxedAppError {
232232
}
233233
}
234234

235+
impl From<crates_io_trustpub::github::validation::ValidationError> for BoxedAppError {
236+
fn from(error: crates_io_trustpub::github::validation::ValidationError) -> Self {
237+
bad_request(error)
238+
}
239+
}
240+
235241
// =============================================================================
236242
// Internal error for use with `chain_error`
237243

0 commit comments

Comments
 (0)