def run_supervised_task(guard, task, *args)
begin
catch Runner.stopping_symbol_for(guard) do
guard.hook("#{ task }_begin", *args)
result = guard.send(task, *args)
guard.hook("#{ task }_end", result)
result
end
rescue NoMethodError
rescue Exception => ex
::Guard::UI.error("#{ guard.class.name } failed to achieve its <#{ task.to_s }>, exception was:" +
"\n#{ ex.class }: #{ ex.message }\n#{ ex.backtrace.join("\n") }")
::Guard.guards.delete guard
::Guard::UI.info("\n#{ guard.class.name } has just been fired")
ex
end
end