Unverified Commit 05627514 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: turn panic into bail (#84927)

Eventual consistency strikes again
parent baf4401c
......@@ -2543,9 +2543,9 @@ impl SourceMapper for CodeGenResultSourceMap {
}
fn span_to_snippet(&self, sp: Span) -> Result<String, Box<SpanSnippetError>> {
match self {
CodeGenResultSourceMap::None => {
panic!("CodeGenResultSourceMap::None cannot span_to_snippet")
}
CodeGenResultSourceMap::None => Err(Box::new(SpanSnippetError::SourceNotAvailable {
filename: FileName::Anon,
})),
CodeGenResultSourceMap::Single { source_map } => source_map.span_to_snippet(sp),
CodeGenResultSourceMap::ScopeHoisting {
modules_header_width,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment