lib/sup/hook.rb in sup-0.9 vs lib/sup/hook.rb in sup-0.9.1

- old
+ new

@@ -76,13 +76,14 @@ def run name, locals={} hook = hook_for(name) or return 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? end result