00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __CODEX_SERVER_SERVEREXCEPTIONS_H__
00019 #define __CODEX_SERVER_SERVEREXCEPTIONS_H__
00020
00021 #include <string>
00022
00023 #include "CODEX_Exceptions/ExceptionBase.h"
00024
00025 namespace CODEX_Server
00026 {
00030 class ExceptionBase : public CODEX_Exceptions::ExceptionBase
00031 {
00032 public :
00038 ExceptionBase( const string& fname, int line ) :
00039 CODEX_Exceptions::ExceptionBase( fname, line )
00040 {}
00041
00043 virtual ~ExceptionBase() {}
00044
00048 void report() const;
00049
00050 protected :
00055 virtual void derivedMsg() const = 0;
00056
00057 };
00058
00060 class PublicKeyNotFoundException : public ExceptionBase
00061 {
00062 public :
00064 PublicKeyNotFoundException( const string& fname, int line ) :
00065 ExceptionBase( fname, line )
00066 {}
00067
00069 ~PublicKeyNotFoundException() {}
00070
00071 protected :
00072 void derivedMsg() const;
00073 };
00074
00076 class CertificateNotFoundException : public ExceptionBase
00077 {
00078 public :
00080 CertificateNotFoundException( const string& fname, int line ) :
00081 ExceptionBase( fname, line )
00082 {}
00083
00085 ~CertificateNotFoundException() {}
00086
00087 protected :
00088 void derivedMsg() const;
00089 };
00090
00092 class SignatureVerificationFailedException : public ExceptionBase
00093 {
00094 public :
00096 SignatureVerificationFailedException( const string& fname, int line ):
00097 ExceptionBase( fname, line )
00098 {}
00099
00101 ~SignatureVerificationFailedException() {}
00102
00103 protected :
00104 void derivedMsg() const;
00105 };
00106
00108 class NoQuorumSystemException : public ExceptionBase
00109 {
00110 public :
00112 NoQuorumSystemException( const string& fname, int line ) :
00113 ExceptionBase( fname, line )
00114 {}
00115
00117 ~NoQuorumSystemException() {}
00118
00119 protected :
00120 void derivedMsg() const;
00121 };
00122
00124 class KeySharesNotFoundException : public ExceptionBase
00125 {
00126 public :
00128 KeySharesNotFoundException( const string& fname, int line ) :
00129 ExceptionBase( fname, line )
00130 {}
00131
00133 ~KeySharesNotFoundException() {}
00134
00135 protected :
00136 void derivedMsg() const;
00137 };
00138
00140 class MalformedMessageException : public ExceptionBase
00141 {
00142 public :
00144 MalformedMessageException( const string& fname, int line ) :
00145 ExceptionBase( fname, line )
00146 {}
00147
00149 ~MalformedMessageException() {}
00150
00151 protected :
00152 void derivedMsg() const;
00153 };
00154
00156 class UnknownSecretNumberException : public ExceptionBase
00157 {
00158 public :
00160 UnknownSecretNumberException( const string& fname,
00161 int line,
00162 unsigned int num ) :
00163 ExceptionBase( fname, line ),
00164 m_num( num)
00165 {}
00166
00168 ~UnknownSecretNumberException() {}
00169
00171 unsigned int num() const { return m_num; }
00172
00173 protected :
00174 void derivedMsg() const;
00175
00176 private :
00177 unsigned int m_num;
00178 };
00179
00181 class InvalidLabelException : public ExceptionBase
00182 {
00183 public :
00185 InvalidLabelException( const string& fname,
00186 int line ) :
00187 ExceptionBase( fname, line )
00188 {}
00189
00191 ~InvalidLabelException() {}
00192
00193 protected :
00194 void derivedMsg() const;
00195 };
00196
00197 }
00198
00199 #endif