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 { ...@@ -2543,9 +2543,9 @@ impl SourceMapper for CodeGenResultSourceMap {
} }
fn span_to_snippet(&self, sp: Span) -> Result<String, Box<SpanSnippetError>> { fn span_to_snippet(&self, sp: Span) -> Result<String, Box<SpanSnippetError>> {
match self { match self {
CodeGenResultSourceMap::None => { CodeGenResultSourceMap::None => Err(Box::new(SpanSnippetError::SourceNotAvailable {
panic!("CodeGenResultSourceMap::None cannot span_to_snippet") filename: FileName::Anon,
} })),
CodeGenResultSourceMap::Single { source_map } => source_map.span_to_snippet(sp), CodeGenResultSourceMap::Single { source_map } => source_map.span_to_snippet(sp),
CodeGenResultSourceMap::ScopeHoisting { CodeGenResultSourceMap::ScopeHoisting {
modules_header_width, 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