Merge branch 'dont_swallow_error_on_running_task' of https://github.com/mcmire/guard into mcmire-dont_swallow_error_on_running_task
This commit is contained in:
commit
5573e0d221
@ -59,11 +59,13 @@ module Guard
|
|||||||
# fire it if his work leads to a system failure
|
# fire it if his work leads to a system failure
|
||||||
def supervised_task(guard, task_to_supervise, *args)
|
def supervised_task(guard, task_to_supervise, *args)
|
||||||
guard.send(task_to_supervise, *args)
|
guard.send(task_to_supervise, *args)
|
||||||
rescue Exception
|
rescue Exception => err
|
||||||
UI.error("#{guard.class.name} guard failed to achieve its <#{task_to_supervise.to_s}> command: #{$!}")
|
UI.error("#{guard.class.name} 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
|
guards.delete guard
|
||||||
UI.info("Guard #{guard.class.name} has just been fired")
|
UI.info("Guard #{guard.class.name} has just been fired")
|
||||||
return $!
|
return err
|
||||||
end
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
|
Loading…
Reference in New Issue
Block a user