@app.route('/scans/<int:scan_id>/exceptions/', methods=['POST'])
@requires_auth
def exception_creator(scan_id):
 scan_info = get_scan_info_from_id(scan_id)
 if (scan_info is None):
  abort(404, 'Scan not found')
 current_status = FakeStatus(None)
 current_status.set_running_plugin('phase', 'plugin')
 current_status.set_current_fuzzable_request('phase', 'http://www.w3af.org/')
 try:
  raise Exception('unittest')
 except Exception as exception:
  exec_info = sys.exc_info()
  enabled_plugins = ''
  scan_info.w3af_core.exception_handler.write_crash_file = (lambda x: x)
  scan_info.w3af_core.exception_handler.handle(current_status, exception, exec_info, enabled_plugins)
 return (jsonify({'code': 201}), 201)

@ app . route ( '/scans/<int:scan_id>/exceptions/' , methods = [ 'POST' ] ) @ requires_auth def exception_creator ( scan_id ) : scan_info = get_scan_info_from_id ( scan_id ) if ( scan_info is None ) : abort ( 404 , 'Scan not found' ) current_status = FakeStatus ( None ) current_status . set_running_plugin ( 'phase' , 'plugin' ) current_status . set_current_fuzzable_request ( 'phase' , 'http://www.w3af.org/' ) try : raise Exception ( 'unittest' ) except Exception as exception : exec_info = sys . exc_info ( ) enabled_plugins = '' scan_info . w3af_core . exception_handler . write_crash_file = ( lambda x : x ) scan_info . w3af_core . exception_handler . handle ( current_status , exception , exec_info , enabled_plugins ) return ( jsonify ( { 'code' : 201 } ) , 201 )
mostly for testing .