"Fossies" - the Fresh Open Source Software Archive

Member "hermes-1.9/src/Exception.h" (29 Jun 2014, 1764 Bytes) of package /linux/privat/hermes-1.9.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 "Exception.h" see the Fossies "Dox" file reference documentation.

    1 /**
    2  * hermes antispam proxy
    3  * Copyright (C) 2006, 2007 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
    4  *
    5  * This program is free software; you can redistribute it and/or modify
    6  * it under the terms of the GNU General Public License as published by
    7  * the Free Software Foundation; version 2 of the License
    8  *
    9  * This program is distributed in the hope that it will be useful,
   10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12  * GNU General Public License for more details.
   13  *
   14  * You should have received a copy of the GNU General Public License along
   15  * with this program; if not, write to the Free Software Foundation, Inc.,
   16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   17  *
   18  * @author Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
   19  */
   20 #ifndef EXCEPTION_H
   21 #define EXCEPTION_H
   22 
   23 #include <iostream>
   24 #include <string>
   25 
   26 #include "Configfile.h"
   27 #include "Logger.h"
   28 
   29 using namespace std;
   30 
   31 class Exception
   32 {
   33   private:
   34     string error;
   35     string file;
   36     unsigned line;
   37     void notifyByEmail(string);
   38   public:
   39     Exception(string,string,unsigned);
   40     operator string();
   41     friend ostream& operator<<(ostream&,Exception&);
   42 };
   43 
   44 class NetworkException:public Exception
   45 {
   46   public:
   47     NetworkException(string p_error,string p_file,int p_line):Exception(p_error,p_file,p_line){}
   48 };
   49 
   50 class SQLException:public Exception
   51 {
   52   public:
   53     SQLException(string p_error,string p_file,int p_line):Exception(p_error,p_file,p_line){}
   54 };
   55 
   56 class NotifyException
   57 {
   58   private:
   59     string error;
   60   public:
   61     NotifyException(string p_error){ error=p_error; }
   62     operator string(){ return "NotifyException: "+error;};
   63 };
   64 #endif //EXCEPTION_H