Skip to content

Commit 2f5343f

Browse files
committed
Turbopack: shorter error for ChunkGroupInfo::get_index_of (#92814)
1 parent 2ad9d3f commit 2f5343f

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

turbopack/crates/turbopack-core/src/module_graph/chunk_group_info.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,20 @@ impl ChunkGroupInfo {
108108
if let Some(idx) = self.chunk_groups.get_index_of(&chunk_group) {
109109
Ok(Vc::cell(idx))
110110
} else {
111-
bail!(
112-
"Couldn't find chunk group index for {} in {}",
113-
chunk_group.debug_str(self).await?,
114-
self.chunk_groups
115-
.iter()
116-
.map(|c| c.debug_str(self))
117-
.try_join()
118-
.await?
119-
.join(", ")
120-
);
111+
if cfg!(debug_assertions) {
112+
bail!(
113+
"Couldn't find chunk group index for {} in {}",
114+
chunk_group.debug_str(self).await?,
115+
self.chunk_groups
116+
.iter()
117+
.map(|c| c.debug_str(self))
118+
.try_join()
119+
.await?
120+
.join(", ")
121+
);
122+
} else {
123+
bail!("Couldn't find chunk group index")
124+
}
121125
}
122126
}
123127
}

0 commit comments

Comments
 (0)