Skip to content

Commit e0dbe57

Browse files
committed
chore: work more on error reporting
1 parent 45b02cb commit e0dbe57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/scenario/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,12 @@ impl Loader {
173173
Self { db }
174174
}
175175

176+
/// Find a row using [`Self::find_row`] and return the column `"result"`.
176177
async fn find(&self, sql: &str) -> anyhow::Result<String> {
177178
Ok(self.find_row(sql).await?.get("result"))
178179
}
179180

181+
/// Find a row, errors when none was found
180182
async fn find_row(&self, sql: &str) -> anyhow::Result<PgRow> {
181183
let mut db = crate::db::connect(&self.db).await?;
182184

@@ -185,6 +187,7 @@ impl Loader {
185187
.ok_or_else(|| anyhow!("nothing found"))
186188
}
187189

190+
/// Find all rows
188191
async fn find_rows(&self, sql: &str) -> anyhow::Result<Vec<PgRow>> {
189192
let mut db = crate::db::connect(&self.db).await?;
190193

@@ -212,7 +215,8 @@ order by
212215
limit 1
213216
"#,
214217
)
215-
.await?;
218+
.await
219+
.context("large_sbom")?;
216220

217221
Ok((row.get("id"), row.get("sha")))
218222
}

0 commit comments

Comments
 (0)