diff options
author | Kim Alvefur <zash@zash.se> | 2021-11-12 16:52:55 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-11-12 16:52:55 +0100 |
commit | 93121127fa4ed579516ab203c3e2696725551d37 (patch) | |
tree | 43574da98ca60673610d6c6b05b402976383f529 /net/connect.lua | |
parent | 30ef01a6cceb7e7acdfa9ff0be8733db8fe0dafd (diff) | |
download | prosody-93121127fa4ed579516ab203c3e2696725551d37.tar.gz prosody-93121127fa4ed579516ab203c3e2696725551d37.zip |
net.connect: Propagate last error message from resolvers
Previously it would only say "unable to resolve server" for all DNS
problems. While "NoError in A lookup" might not make much sense to
users, it should help in debugging more than the previous generic error.
Friendlier errors will be future work.
Diffstat (limited to 'net/connect.lua')
-rw-r--r-- | net/connect.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/connect.lua b/net/connect.lua index d52d3901..51c36c7b 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -35,9 +35,9 @@ local function attempt_connection(p) p.target_resolver:next(function (conn_type, ip, port, extra) if not conn_type then -- No more targets to try - p:log("debug", "No more connection targets to try"); + p:log("debug", "No more connection targets to try", p.target_resolver.last_error); if p.listeners.onfail then - p.listeners.onfail(p.data, p.last_error or "unable to resolve service"); + p.listeners.onfail(p.data, p.target_resolver.last_error or p.last_error or "unable to resolve service"); end return; end |