Prevent potential side effects and use local variables here
[pdns-ldap-backend/landonf.git] / src / exceptions.hh
blob53e0145f5e7f34a5bf66eb6d6eec976e93054101
1 /*
2 * PowerDNS LDAP Connector
3 * By PowerDNS.COM BV
4 * By Norbert Sendetzky <norbert@linuxnetworks.de> (2003-2007)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <exception>
21 #include <stdexcept>
22 #include <string>
24 #ifndef LDAPEXCEPTIONS_HH
25 #define LDAPEXCEPTIONS_HH
27 class LDAPException : public std::runtime_error
29 public:
30 explicit LDAPException( const std::string &str ) : std::runtime_error( str ) {}
33 class LDAPTimeout : public LDAPException
35 public:
36 explicit LDAPTimeout() : LDAPException( "Timeout" ) {}
39 class LDAPNoConnection : public LDAPException
41 public:
42 explicit LDAPNoConnection() : LDAPException( "No connection to LDAP server" ) {}
45 #endif // LDAPEXCEPTIONS_HH