Skip to content

Commit 653a3bf

Browse files
committed
Fixed error handling
1 parent 8901c38 commit 653a3bf

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/worker/jobs/update_default_version.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ impl BackgroundJob for UpdateDefaultVersion {
4040
.first::<String>(&mut conn)
4141
.await,
4242
);
43-
if let Err(diesel::result::Error::DatabaseError(
44-
diesel::result::DatabaseErrorKind::ForeignKeyViolation,
45-
..,
46-
)) = crate_name
47-
{
43+
44+
if matches!(
45+
crate_name,
46+
Err(diesel::result::Error::DatabaseError(
47+
diesel::result::DatabaseErrorKind::ForeignKeyViolation,
48+
..,
49+
)) | Err(diesel::result::Error::NotFound)
50+
) {
4851
warn!("Skipping update default version for crate for {crate_id}: no crate found");
4952
return Ok(());
5053
}

0 commit comments

Comments
 (0)