attester/attester — pull request #79 by jakub-g (2014-04-09 12:49:26+00:00)
Title: Improve error handling for PhantomJS

1) Try to reboot Phantom instance (3 times) if it died from recoverable error
2) Exit attester when all PhantomJS instances died without hope to recover

This fixes the following issues:

- In case it was impossible to connect to attester by PhantomJS
instance within specified timeout, the phantom process was exiting,
but without propagating the error to attester.
Now it propagates the error, and additionally the timeout was increased

- Now once the page emits `DOMContentLoaded`, the timeout starts from zero

- If all PhantomJS processes die (i.e. exit with code != 0) for any reason,
now this is caught and makes attester exit with non-zero code too.