make sure pending results respond to failures

This commit is contained in:
John Bintz 2012-04-17 11:54:32 -04:00
parent 985634331f
commit 58ebd113ba
2 changed files with 13 additions and 5 deletions

View File

@ -7,6 +7,8 @@ module Flowerbox::Result
def failure? def failure?
false false
end end
def failures; [] ; end
end end
end end

View File

@ -47,12 +47,18 @@ module Flowerbox
ws.onmessage { |message| ws.onmessage { |message|
command, data = JSON.parse(message) command, data = JSON.parse(message)
output = runner.send(command, [ data ].flatten) begin
output = runner.send(command, [ data ].flatten)
if command == 'load' if command == 'load'
ws.send(output) ws.send(output)
else else
ws.send("ok") ws.send("ok")
end
rescue => e
$stderr.puts e.message
exit 1
end end
} }
end end