diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_cgiirc.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 41 | ||||
-rw-r--r-- | src/modules/m_testcommand.cpp | 4 |
3 files changed, 34 insertions, 13 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 688da6f05..f81b97fed 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -72,7 +72,7 @@ class CGIResolver : public Resolver } } - virtual void OnError(ResolverError e) + virtual void OnError(ResolverError e, const std::string &errormessage) { if ((them) && (them == fd_ref_table[theirfd])) { 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; } diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index 3b27d01d9..fb061a898 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -35,9 +35,9 @@ class MyResolver : public Resolver log(DEBUG,"*** RESOLVER COMPLETED LOOKUP, IP IS: '%s'",result.c_str()); } - virtual void OnError(ResolverError e) + virtual void OnError(ResolverError e, const std::string &errormessage) { - log(DEBUG,"*** RESOLVER GOT ERROR: %d",e); + log(DEBUG,"*** RESOLVER GOT ERROR: %d: %s",e,errormessage.c_str()); } }; |