MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / error_handler

Function error_handler

thirdparty/keepalive/keepalive.py:493–517  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

491#########################################################################
492
493def error_handler(url):
494 global HANDLE_ERRORS
495 orig = HANDLE_ERRORS
496 keepalive_handler = HTTPHandler()
497 opener = _urllib.request.build_opener(keepalive_handler)
498 _urllib.request.install_opener(opener)
499 pos = {0: 'off', 1: 'on'}
500 for i in (0, 1):
501 print(" fancy error handling %s (HANDLE_ERRORS = %i)" % (pos[i], i))
502 HANDLE_ERRORS = i
503 try:
504 fo = _urllib.request.urlopen(url)
505 foo = fo.read()
506 fo.close()
507 try: status, reason = fo.status, fo.reason
508 except AttributeError: status, reason = None, None
509 except IOError as e:
510 print(" EXCEPTION: %s" % e)
511 raise
512 else:
513 print(" status = %s, reason = %s" % (status, reason))
514 HANDLE_ERRORS = orig
515 hosts = keepalive_handler.open_connections()
516 print("open connections:", hosts)
517 keepalive_handler.close_all()
518
519def continuity(url):
520 from hashlib import md5

Callers 1

testFunction · 0.85

Calls 5

HTTPHandlerClass · 0.85
open_connectionsMethod · 0.80
close_allMethod · 0.80
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…