Permalink
Browse files

Handle non-local exits in tracing.

  • Loading branch information...
1 parent f74d056 commit 46b1b541835a260dc0b1f99324c0a010d7dbce11 @oggy oggy committed May 1, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/rack/bug/panels/templates_panel.rb
@@ -7,12 +7,15 @@ class TemplatesPanel < Panel
autoload :Trace, "rack/bug/panels/templates_panel/trace"
autoload :Rendering, "rack/bug/panels/templates_panel/rendering"
- def self.record(template, &block)
- return block.call unless Rack::Bug.enabled?
+ def self.record(template)
+ return yield unless Rack::Bug.enabled?
template_trace.start(template)
- result = block.call
- template_trace.finished(template)
+ begin
+ result = yield
+ ensure
+ template_trace.finished(template)
+ end
return result
end

0 comments on commit 46b1b54

Please sign in to comment.