Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

If running a task for a guard and it borks, don't swallow the error b…

…ut print the backtrace
  • Loading branch information...
commit b41f31e4206c1df89362b1a1bb836018de0109a8 1 parent d51b457
@mcmire authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/guard.rb
8 lib/guard.rb
@@ -59,11 +59,13 @@ def run_on_change_for_all_guards(files)
# fire it if his work leads to a system failure
def supervised_task(guard, task_to_supervise, *args)
guard.send(task_to_supervise, *args)
- rescue Exception
- UI.error("#{} guard failed to achieve its <#{task_to_supervise.to_s}> command: #{$!}")
+ rescue Exception => err
+ UI.error("#{} guard failed to achieve its <#{task_to_supervise.to_s}> command: #{err}")
+ warn "#{err.class}: #{err.message}"
+ warn err.backtrace.join("\n")
guards.delete guard"Guard #{} has just been fired")
- return $!
+ return err
def run
Please sign in to comment.
Something went wrong with that request. Please try again.