From 357629f180f493f1996186e6d949f67a842ecd1f Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 2 Jun 2017 02:32:39 +1000 Subject: [PATCH] added error passing --- HTTPy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/HTTPy.py b/HTTPy.py index 3f76729..a28e5de 100755 --- a/HTTPy.py +++ b/HTTPy.py @@ -37,7 +37,13 @@ def dig(inDomain, record): def ipLookup(inDomain): ipLook = subprocess.check_output(["geoiplookup", inDomain]) - host = subprocess.check_call(["host", inDomain]) #Do exit status check... + try: + host = subprocess.check_output(["host", inDomain]) #Do exit status check... + returncode = 0 + except CalledProcessError as e: + output = o.output + returncode = e.returncode + print ipLook, "PTR: ", host def getInput():