Skip to content

Commit 2e264ff

Browse files
committed
Updates
1 parent 16661f5 commit 2e264ff

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

circl-ip

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ async def fetch(url, address, session):
4141
sys.stdout.flush()
4242
except KeyError as e:
4343
sys.stderr.write('%s => KeyError: %s [%s]\n' % (address, e, line))
44+
elif response.status == 401:
45+
sys.stderr.write(f"{url + address} => Authentication failed: is authentication correct?\n")
46+
elif response.status == 403:
47+
sys.stderr.write(f"{url + address} => Not authorized to access resource\n")
48+
elif response.status == 429:
49+
sys.stderr.write(f"{url + address} => Quota exhausted\n")
4450
else:
45-
sys.stderr.write(f"{url + address} => Unexpected response status: {response.status}\n")
51+
sys.stderr.write(f"{url + address} => Unexpected response, status {response.status}\n")
4652
except Exception as e:
47-
sys.stderr.write(f"{url + address} => Unexpected exception: {e}\n")
53+
sys.stderr.write(f"{url + address} => Unexpected exception, {e}\n")
4854

4955
async def run(addresses):
5056
url = "https://www.circl.lu/pdns/query/"

0 commit comments

Comments
 (0)