"Fossies" - the Fresh Open Source Software Archive

Member "pdns-auth-4.2.0/modules/ldapbackend/exceptions.hh" (27 Aug 2019, 1471 Bytes) of package /linux/misc/dns/pdns-auth-4.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "exceptions.hh" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 4.1.13_vs_4.2.0.

    1 /*
    2  *  PowerDNS LDAP Connector
    3  *  By PowerDNS.COM BV
    4  *  By Norbert Sendetzky <norbert@linuxnetworks.de> (2003-2007)
    5  *
    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.
    9  *
   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.
   14  *
   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
   18  */
   19 
   20 #include <exception>
   21 #include <stdexcept>
   22 #include <string>
   23 
   24 #ifndef LDAPEXCEPTIONS_HH
   25 #define LDAPEXCEPTIONS_HH
   26 
   27 class LDAPException : public std::runtime_error
   28 {
   29   public:
   30     explicit LDAPException( const std::string &str ) : std::runtime_error( str ) {}
   31 };
   32 
   33 class LDAPTimeout : public LDAPException
   34 {
   35   public:
   36     explicit LDAPTimeout() : LDAPException( "Timeout" ) {}
   37 };
   38 
   39 class LDAPNoConnection : public LDAPException
   40 {
   41   public:
   42     explicit LDAPNoConnection() : LDAPException( "No connection to LDAP server" ) {}
   43 };
   44 
   45 class LDAPNoSuchObject : public LDAPException
   46 {
   47   public:
   48     explicit LDAPNoSuchObject() : LDAPException( "No such object" ) {}
   49 };
   50 
   51 #endif // LDAPEXCEPTIONS_HH