From: Grégory Oestreicher Date: Thu, 22 Jun 2017 19:50:47 +0000 (+0200) Subject: Don't add braces with throw X-Git-Tag: dnsdist-1.3.1~167^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b19fb4e04e4eed0b58db59b182b0cbb430d98378;p=thirdparty%2Fpdns.git Don't add braces with throw --- diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 428c94f406..469f595e94 100644 --- a/modules/ldapbackend/ldapbackend.cc +++ b/modules/ldapbackend/ldapbackend.cc @@ -111,7 +111,7 @@ LdapBackend::LdapBackend( const string &suffix ) } if( m_pldap != NULL ) { delete( m_pldap ); } - throw( PDNSException( "Unable to connect to ldap server" ) ); + throw PDNSException( "Unable to connect to ldap server" ); } @@ -159,7 +159,7 @@ bool LdapBackend::list( const DNSName& target, int domain_id, bool include_disab catch( LDAPTimeout < ) { g_log << Logger::Warning << m_myname << " Unable to get zone " << target << " from LDAP directory: " << lt.what() << endl; - throw( DBException( "LDAP server timeout" ) ); + throw DBException( "LDAP server timeout" ); } catch( LDAPNoConnection &lnc ) { @@ -172,12 +172,12 @@ bool LdapBackend::list( const DNSName& target, int domain_id, bool include_disab catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Unable to get zone " << target << " from LDAP directory: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { g_log << Logger::Error << m_myname << " Caught STL exception for target " << target << ": " << e.what() << endl; - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } return false; @@ -247,7 +247,7 @@ void LdapBackend::lookup( const QType &qtype, const DNSName &qname, DNSPacket *d catch( LDAPTimeout < ) { g_log << Logger::Warning << m_myname << " Unable to search LDAP directory: " << lt.what() << endl; - throw( DBException( "LDAP server timeout" ) ); + throw DBException( "LDAP server timeout" ); } catch( LDAPNoConnection &lnc ) { @@ -260,12 +260,12 @@ void LdapBackend::lookup( const QType &qtype, const DNSName &qname, DNSPacket *d catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Unable to search LDAP directory: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { g_log << Logger::Error << m_myname << " Caught STL exception for qname " << qname << ": " << e.what() << endl; - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } } @@ -521,17 +521,17 @@ bool LdapBackend::get( DNSResourceRecord &rr ) catch( LDAPTimeout < ) { g_log << Logger::Warning << m_myname << " Search failed: " << lt.what() << endl; - throw( DBException( "LDAP server timeout" ) ); + throw DBException( "LDAP server timeout" ); } catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Search failed: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { g_log << Logger::Error << m_myname << " Caught STL exception for " << m_qname << ": " << e.what() << endl; - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } return false; @@ -558,7 +558,7 @@ void LdapBackend::getUpdatedMasters( vector* domains ) catch( LDAPTimeout < ) { g_log << Logger::Warning << m_myname << " Unable to search LDAP directory: " << lt.what() << endl; - throw( DBException( "LDAP server timeout" ) ); + throw DBException( "LDAP server timeout" ); } catch( LDAPNoConnection &lnc ) { @@ -571,11 +571,11 @@ void LdapBackend::getUpdatedMasters( vector* domains ) catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Unable to search LDAP directory: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } while( m_pldap->getSearchEntry( msgid, result ) ) { @@ -611,7 +611,7 @@ void LdapBackend::setNotified( uint32_t id, uint32_t serial ) catch( LDAPTimeout < ) { g_log << Logger::Warning << m_myname << " Unable to search LDAP directory: " << lt.what() << endl; - throw( DBException( "LDAP server timeout" ) ); + throw DBException( "LDAP server timeout" ); } catch( LDAPNoConnection &lnc ) { @@ -624,11 +624,11 @@ void LdapBackend::setNotified( uint32_t id, uint32_t serial ) catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Unable to search LDAP directory: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } if ( results.empty() ) @@ -665,11 +665,11 @@ void LdapBackend::setNotified( uint32_t id, uint32_t serial ) catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Unable to search LDAP directory: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } } @@ -700,7 +700,7 @@ bool LdapBackend::getDomainInfo( const DNSName& domain, DomainInfo& di, bool get catch( LDAPTimeout < ) { g_log << Logger::Warning << m_myname << " Unable to search LDAP directory: " << lt.what() << endl; - throw( DBException( "LDAP server timeout" ) ); + throw DBException( "LDAP server timeout" ); } catch( LDAPNoConnection &lnc ) { @@ -713,11 +713,11 @@ bool LdapBackend::getDomainInfo( const DNSName& domain, DomainInfo& di, bool get catch( LDAPException &le ) { g_log << Logger::Error << m_myname << " Unable to search LDAP directory: " << le.what() << endl; - throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server + throw PDNSException( "LDAP server unreachable" ); // try to reconnect to another server } catch( std::exception &e ) { - throw( DBException( "STL exception" ) ); + throw DBException( "STL exception" ); } if( result.count( "sOARecord" ) && !result["sOARecord"].empty() ) diff --git a/modules/ldapbackend/ldaputils.cc b/modules/ldapbackend/ldaputils.cc index 92d888b7ea..13c929da3f 100644 --- a/modules/ldapbackend/ldaputils.cc +++ b/modules/ldapbackend/ldaputils.cc @@ -5,7 +5,7 @@ void ldapSetOption( LDAP *conn, int option, void *value ) { if( ldap_set_option( conn, option, value ) != LDAP_OPT_SUCCESS ) { - throw( LDAPException( "Unable to set option" ) ); + throw LDAPException( "Unable to set option" ); } } @@ -13,7 +13,7 @@ void ldapGetOption( LDAP *conn, int option, void *value ) { if( ldap_get_option( conn, option, value ) != LDAP_OPT_SUCCESS ) { - throw( LDAPException( "Unable to get option" ) ); + throw LDAPException( "Unable to get option" ); } }