Skip to content

Commit

Permalink
Some errors are not Critical errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sandreae committed Aug 9, 2023
1 parent 5cb5ece commit 196c1fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aquadoggo/src/materializer/tasks/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub async fn blob_task(context: Context, input: TaskInput) -> TaskResult<TaskInp
.store
.get_document_by_view_id(&input_view_id)
.await
.map_err(|err| TaskError::Critical(err.to_string()))?
.map_err(|err| TaskError::Failure(err.to_string()))?
.unwrap();
Ok(vec![document])

Check warning on line 50 in aquadoggo/src/materializer/tasks/blob.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/materializer/tasks/blob.rs#L44-L50

Added lines #L44 - L50 were not covered by tests
}
Expand All @@ -72,7 +72,9 @@ pub async fn blob_task(context: Context, input: TaskInput) -> TaskResult<TaskInp
.store
.get_blob_by_view_id(blob_document.view_id())
.await

Check warning on line 74 in aquadoggo/src/materializer/tasks/blob.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/materializer/tasks/blob.rs#L71-L74

Added lines #L71 - L74 were not covered by tests
.map_err(|err| TaskError::Critical(err.to_string()))?
// We don't raise a critical error here, as it is possible that this method returns an
// error.
.map_err(|err| TaskError::Failure(err.to_string()))?
.unwrap();

Check warning on line 78 in aquadoggo/src/materializer/tasks/blob.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/materializer/tasks/blob.rs#L77-L78

Added lines #L77 - L78 were not covered by tests

// Compose, and when needed create, the path for the blob file.
Expand Down Expand Up @@ -143,7 +145,7 @@ async fn get_related_blobs(
continue;

Check warning on line 145 in aquadoggo/src/materializer/tasks/blob.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/materializer/tasks/blob.rs#L145

Added line #L145 was not covered by tests
}
} else {
// Abort if there are blobs in the store that don't match the blob schema.
// It is a critical if there are blobs in the store that don't match the blob schema.
Err(TaskError::Critical(
"Blob operation does not have a 'pieces' operation field".into(),
))?

Check warning on line 151 in aquadoggo/src/materializer/tasks/blob.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/materializer/tasks/blob.rs#L149-L151

Added lines #L149 - L151 were not covered by tests
Expand Down

0 comments on commit 196c1fc

Please sign in to comment.