From 8678cc2915c33c5fa426ed8157e76924748b08e4 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 11 Dec 2020 10:15:30 +0000 Subject: net.http.errors: Add error class for DNS resolution failures (thanks SouL) --- net/http/errors.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net') diff --git a/net/http/errors.lua b/net/http/errors.lua index ae45d5a8..1691e426 100644 --- a/net/http/errors.lua +++ b/net/http/errors.lua @@ -40,6 +40,10 @@ local error_templates = { code = 0, type = "modify", condition = "bad-request"; text = "Invalid URL"; }; + ["unable to resolve service"] = { + code = 0, type = "cancel", condition = "remote-server-not-found"; + text = "DNS resolution failed"; + }; -- This doesn't attempt to map every single HTTP code (not all have sane mappings), -- but all the common ones should be covered. XEP-0086 was used as reference for -- cgit v1.2.3