djblets.extensions.SignalHook sandboxing

Review Request #6554 — Created Nov. 4, 2014 and submitted

Information

Djblets
master
24060c0...

Reviewers

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.

Description From Last Updated

Add a docstring explaining what this method does.

brenniebrennie

Docstrings should only be 1 line.

brenniebrennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
  2. 
      
brennie
  1. Only a bit of stylistic stuff; it looks good.

  2. djblets/extensions/hooks.py (Diff revision 1)
     
     
    Show all issues

    Add a docstring explaining what this method does.

  3. djblets/extensions/tests.py (Diff revision 1)
     
     
     
    Show all issues

    Docstrings should only be 1 line.

  4. 
      
justy777
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
justy777
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.8.x (1a4be29)