djblets.extensions.SignalHook sandboxing
Review Request #6554 — Created Nov. 4, 2014 and submitted
Extensions that use a SignalHook to connect to a signal and run a callback function can throw exceptions inside Djblets. To fix this a new parameter, sandbox_errors which by default is set to True, has been added to SignalHook.
Now when sandbox_errors is set to True it will wrap the callback function in another function to log the exceptions that are thrown. If sandbox_errors is set to False, exceptions that are thrown are not caught by Djblets.
Two unit tests have been written to make sure the new parameter sandbox_errors logs exceptions when set to True, and does not log exceptions when set to False.
The test fails without the sandboxing, and succeeds with it.