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?
false
end
def failures; [] ; end
end
end

View File

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