def errstr (exc):
	try:
		code = exc.args[0] if exc.args else exc.errno
		return '[Errno %s] %s' % (errno.errorcode.get(code,str(code)),str(exc))
	except KeyError:
		return '[Errno unknown (key)] %s' % str(exc)
	except __HOLE__:
		return '[Errno unknown (attr)] %s' % str(exc)
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/util/errstr.py/errstr