Added function collection
This commit is contained in:
parent
da7f850496
commit
444f169b86
1 changed files with 9 additions and 1 deletions
|
@ -3,4 +3,12 @@ from sys import exc_info
|
|||
|
||||
def capture_trace():
|
||||
exc_type, exc_value, exc_traceback = exc_info()
|
||||
print_exception(exc_type, exc_value, exc_traceback)
|
||||
print_exception(exc_type, exc_value, exc_traceback)
|
||||
|
||||
def is_socket_related_error(error):
|
||||
if type(error) not in (BrokenPipeError, ConnectionResetError, OSError):
|
||||
return False
|
||||
if type(error) is OSError:
|
||||
if str(error) not in ("Connection closed", "[Errno 9] Bad file descriptor"):
|
||||
return False
|
||||
return True
|
Reference in a new issue