Skip to content

Commit 26923db

Browse files
committed
Fix backtrace display in error page
1 parent 6ea9f70 commit 26923db

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

examples/bad.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export template {
2+
div {
3+
markdown <<~MD
4+
```ruby
5+
@buffer << #{foo}
6+
```
7+
MD
8+
}
9+
}.tap { puts '!' * 40; puts Papercraft.compiled_code(it.proc); puts}

lib/syntropy/applets/builtin/default_error_handler.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030

3131
def transform_backtrace(backtrace)
3232
backtrace.map do
33-
location = it.match(/^(.+:\d+):/)[1]
34-
{ entry: it, url: "vscode://file/#{location}" }
33+
if (m = it.match(/^(.+:\d+):/))
34+
location = m[1]
35+
{ entry: it, url: "vscode://file/#{location}" }
36+
else
37+
{ entry: it, url: nil }
38+
end
3539
end
3640
end
3741

0 commit comments

Comments
 (0)