Skip to content

Commit 731a088

Browse files
Merge pull request #1120 from Mark-Simulacrum/improve-error
Better error on absent next commit
2 parents 3336d38 + fb6b710 commit 731a088

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

site/src/comparison.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ pub async fn handle_triage(
3232
let start_artifact = ctxt
3333
.artifact_id_for_bound(start.clone(), true)
3434
.ok_or(format!("could not find start commit for bound {:?}", start))?;
35+
// This gives a better error, but is still not great -- the common case here
36+
// is that we've had a 422 error and as such had a fork. It's possible we
37+
// could diagnose that and give a nicer error here telling the user which
38+
// commit to use.
3539
let mut next = next_commit(&start_artifact, &master_commits)
3640
.map(|c| Bound::Commit(c.sha.clone()))
37-
.unwrap(); // TODO: handle no next commit
41+
.ok_or(format!("no next commit for {:?}", start_artifact))?;
3842

3943
let mut report = HashMap::new();
4044
let mut before = start.clone();

0 commit comments

Comments
 (0)