From 1bbb8bedee11f8397b50bb175024788a8eda2137 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 13 Nov 2021 01:20:26 -0800 Subject: [PATCH] Use voussoirkit.httperrors. --- voussoirkit/networktools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/voussoirkit/networktools.py b/voussoirkit/networktools.py index a496f7f..82924bd 100644 --- a/voussoirkit/networktools.py +++ b/voussoirkit/networktools.py @@ -9,6 +9,7 @@ import requests import socket import time +from voussoirkit import httperrors from voussoirkit import vlogging log = vlogging.getLogger(__name__, 'networktools') @@ -26,7 +27,7 @@ class NoInternet(NetworkToolsException): def get_external_ip(timeout=10) -> str: url = 'https://voussoir.net/whatsmyip' response = requests.get(url, timeout=timeout) - response.raise_for_status() + httperrors.raise_for_status(response) ip = response.text.strip() return ip