Created
          December 27, 2012 15:40 
        
      - 
      
 - 
        
Save alonho/4389137 to your computer and use it in GitHub Desktop.  
    Flask: drop into pdb on exception
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def drop_into_pdb(app, exception): | |
| import sys | |
| import pdb | |
| import traceback | |
| traceback.print_exc() | |
| pdb.post_mortem(sys.exc_info()[2]) | |
| # somewhere in your code (probably if DEBUG is True) | |
| flask.got_request_exception.connect(drop_into_pdb) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment