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.

   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 <>
Reviewed-by: Todd Broch <>
Reviewed-by: Jeremy Thorpe <>
1 file changed