commit c924164c22a7bdb3fb66f9ce4ca5ac8b19dfcccf
parent 93b5552730c10e2a352bd33f5ee98800bcd8679e
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Tue, 6 Oct 2009 11:03:03 -0400
include hook filename in error messages
It's visible in the backtrace, but this makes it a little more obvious.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb
@@ -78,10 +78,11 @@ class HookManager
context = @contexts[hook] ||= HookContext.new(name)
result = nil
+ fn = fn_for name
begin
- result = context.__run hook, fn_for(name), locals
+ result = context.__run hook, fn, locals
rescue Exception => e
- log "error running hook: #{e.message}"
+ log "error running #{fn}: #{e.message}"
log e.backtrace.join("\n")
@hooks[name] = nil # disable it
BufferManager.flash "Error running hook: #{e.message}" if BufferManager.instantiated?