Catch servod exceptions properly

When ran in chroot, many Python scripts are invoked through a wrapper,
which imports the script and executes the script's main() function. In
this case exception handler outside main() never gets a chance to run.

Add an exceptions catcher wrapper to make sure problems and ^C are
handled gracefully even when imported by a wrapper.

BUG=none
TEST=manual
   start servod and then terminate it with ^C. Observe the program
   stopping without printing Python stack backtrace

Change-Id: I6dcca9f26f1e0f37d8e9aef31bce0281ec6b6985
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/179410
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Jeremy Thorpe <jeremyt@google.com>
1 file changed