diff options
| author | 2006-08-02 18:44:13 +0000 | |
|---|---|---|
| committer | 2006-08-02 18:44:13 +0000 | |
| commit | e65b2c70e43882a8b4f31df78b5f9242140320f9 (patch) | |
| tree | a6cb1a4c91aec13418e8c0322be3968e71227876 /src/modules/m_spanningtree.cpp | |
| parent | The great summer clean (better than a spring clean) (diff) | |
| download | inspircd++-e65b2c70e43882a8b4f31df78b5f9242140320f9.tar.gz inspircd++-e65b2c70e43882a8b4f31df78b5f9242140320f9.tar.bz2 inspircd++-e65b2c70e43882a8b4f31df78b5f9242140320f9.zip | |
Add error messages to Resolver::OnError()
Add exception handling to several places that use Resolver (it can throw)
Remove Resolver::ProcessResult(), its now handled within the bowels of dns.cpp
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4646 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
| -rw-r--r-- | src/modules/m_spanningtree.cpp | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 3a811d1fa..76de8af3a 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3092,10 +3092,10 @@ class ServernameResolver : public Resolver } } - void OnError(ResolverError e) + void OnError(ResolverError e, const std::string &errormessage) { /* Ooops! */ - WriteOpers("*** CONNECT: Error connecting \002%s\002: Unable to resolve hostname.",MyLink.Name.c_str()); + WriteOpers("*** CONNECT: Error connecting \002%s\002: Unable to resolve hostname - %s",MyLink.Name.c_str(),errormessage.c_str()); } }; @@ -3114,9 +3114,9 @@ class SecurityIPResolver : public Resolver ValidIPs.push_back(result); } - void OnError(ResolverError e) + void OnError(ResolverError e, const std::string &errormessage) { - log(DEBUG,"Could not resolve IP associated with Link '%s'!",MyLink.Name.c_str()); + log(DEBUG,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); } }; @@ -3347,8 +3347,15 @@ void ReadConfiguration(bool rebind) insp_inaddr binip; if (insp_aton(L.IPAddr.c_str(), &binip) < 1) { - SecurityIPResolver* sr = new SecurityIPResolver(L.IPAddr, L); - Srv->AddResolver(sr); + try + { + SecurityIPResolver* sr = new SecurityIPResolver(L.IPAddr, L); + Srv->AddResolver(sr); + } + catch (ModuleException& e) + { + log(DEBUG,"Error in resolver: %s",e.GetReason()); + } } LinkBlocks.push_back(L); @@ -3752,8 +3759,15 @@ class ModuleSpanningTree : public Module } else { - ServernameResolver* snr = new ServernameResolver(x->IPAddr, *x); - Srv->AddResolver(snr); + try + { + ServernameResolver* snr = new ServernameResolver(x->IPAddr, *x); + Srv->AddResolver(snr); + } + catch (ModuleException& e) + { + log(DEBUG,"Error in resolver: %s",e.GetReason()); + } } } @@ -3826,8 +3840,15 @@ class ModuleSpanningTree : public Module } else { - ServernameResolver* snr = new ServernameResolver(x->IPAddr, *x); - Srv->AddResolver(snr); + try + { + ServernameResolver* snr = new ServernameResolver(x->IPAddr, *x); + Srv->AddResolver(snr); + } + catch (ModuleException& e) + { + log(DEBUG,"Error in resolver: %s",e.GetReason()); + } } return 1; } |
