00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CODEX_SERVER_SERVEREXCEPTIONS_H__
00022 #define __CODEX_SERVER_SERVEREXCEPTIONS_H__
00023
00024 #include <string>
00025
00026 #include "CODEX_Exceptions/ExceptionBase.h"
00027
00028 namespace CODEX_Server
00029 {
00033 class ExceptionBase : public CODEX_Exceptions::ExceptionBase
00034 {
00035 public :
00041 ExceptionBase( const string& fname, int line ) :
00042 CODEX_Exceptions::ExceptionBase( fname, line )
00043 {}
00044
00046 virtual ~ExceptionBase() {}
00047
00051 void report() const;
00052
00053 protected :
00058 virtual void derivedMsg() const = 0;
00059
00060 };
00061
00063 class PublicKeyNotFoundException : public ExceptionBase
00064 {
00065 public :
00067 PublicKeyNotFoundException( const string& fname, int line ) :
00068 ExceptionBase( fname, line )
00069 {}
00070
00072 ~PublicKeyNotFoundException() {}
00073
00074 protected :
00075 void derivedMsg() const;
00076 };
00077
00079 class CertificateNotFoundException : public ExceptionBase
00080 {
00081 public :
00083 CertificateNotFoundException( const string& fname, int line ) :
00084 ExceptionBase( fname, line )
00085 {}
00086
00088 ~CertificateNotFoundException() {}
00089
00090 protected :
00091 void derivedMsg() const;
00092 };
00093
00095 class SignatureVerificationFailedException : public ExceptionBase
00096 {
00097 public :
00099 SignatureVerificationFailedException( const string& fname, int line ):
00100 ExceptionBase( fname, line )
00101 {}
00102
00104 ~SignatureVerificationFailedException() {}
00105
00106 protected :
00107 void derivedMsg() const;
00108 };
00109
00111 class NoQuorumSystemException : public ExceptionBase
00112 {
00113 public :
00115 NoQuorumSystemException( const string& fname, int line ) :
00116 ExceptionBase( fname, line )
00117 {}
00118
00120 ~NoQuorumSystemException() {}
00121
00122 protected :
00123 void derivedMsg() const;
00124 };
00125
00127 class KeySharesNotFoundException : public ExceptionBase
00128 {
00129 public :
00131 KeySharesNotFoundException( const string& fname, int line ) :
00132 ExceptionBase( fname, line )
00133 {}
00134
00136 ~KeySharesNotFoundException() {}
00137
00138 protected :
00139 void derivedMsg() const;
00140 };
00141
00143 class MalformedMessageException : public ExceptionBase
00144 {
00145 public :
00147 MalformedMessageException( const string& fname, int line ) :
00148 ExceptionBase( fname, line )
00149 {}
00150
00152 ~MalformedMessageException() {}
00153
00154 protected :
00155 void derivedMsg() const;
00156 };
00157
00159 class UnknownSecretNumberException : public ExceptionBase
00160 {
00161 public :
00163 UnknownSecretNumberException( const string& fname,
00164 int line,
00165 unsigned int num ) :
00166 ExceptionBase( fname, line ),
00167 m_num( num)
00168 {}
00169
00171 ~UnknownSecretNumberException() {}
00172
00174 unsigned int num() const { return m_num; }
00175
00176 protected :
00177 void derivedMsg() const;
00178
00179 private :
00180 unsigned int m_num;
00181 };
00182
00184 class InvalidLabelException : public ExceptionBase
00185 {
00186 public :
00188 InvalidLabelException( const string& fname,
00189 int line ) :
00190 ExceptionBase( fname, line )
00191 {}
00192
00194 ~InvalidLabelException() {}
00195
00196 protected :
00197 void derivedMsg() const;
00198 };
00199
00200 }
00201
00202 #endif