libdigidocpp
|
#include <Exception.h>
Public Types | |
enum | ExceptionCode { CertificateIssuerMissing = 10, CertificateRevoked = 5, CertificateUnknown = 6, NoException = 0, OCSPResponderMissing = 8, OCSPCertMissing = 9, OCSPTimeSlot = 7, OCSPRequestUnauthorized = 11, PINCanceled = 2, PINFailed = 4, PINIncorrect = 1, PINLocked = 3 } |
typedef std::vector< Exception > | Causes |
Public Member Functions | |
Exception (const std::string &file, int line, const std::string &msg) | |
Exception (const std::string &file, int line, const std::string &msg, const Exception &cause) | |
ExceptionCode | code () const |
int | ddoc () const |
std::string | getMsg () const |
bool | hasCause () const |
Causes | getCauses () const |
void | addCause (const Exception &cause) |
void | setCode (ExceptionCode Code) |
void | setDDoc (int err) |
Protected Attributes | |
std::string | file |
std::string | msg |
int | line |
int | m_ddoc |
Causes | causes |
ExceptionCode | m_code |
Base exception class of the digidoc implementation. Digidoc library should never throw exceptions other type than instance of this class or class inherited from this class like IOException or BDocException.
Definition at line 36 of file Exception.h.
typedef std::vector<Exception> digidoc::Exception::Causes |
Definition at line 56 of file Exception.h.
Exception code
CertificateIssuerMissing | |
CertificateRevoked | |
CertificateUnknown | |
NoException | |
OCSPResponderMissing | |
OCSPCertMissing | |
OCSPTimeSlot | |
OCSPRequestUnauthorized | |
PINCanceled | |
PINFailed | |
PINIncorrect | |
PINLocked |
Definition at line 42 of file Exception.h.
Exception::Exception | ( | const std::string & | file, |
int | line, | ||
const std::string & | msg | ||
) |
file | filename, where the exception was thrown. |
line | line of the file, where the exception was thrown. |
msg | error message. |
Definition at line 31 of file Exception.cpp.
Exception::Exception | ( | const std::string & | file, |
int | line, | ||
const std::string & | msg, | ||
const Exception & | cause | ||
) |
Convenience constructor when there is just one cause for this Exception.
file | filename, where the exception was thrown. |
line | line of the file, where the exception was thrown. |
msg | error message. |
cause | cause of the exception. |
Definition at line 51 of file Exception.cpp.
References addCause(), DEBUG2, and line.
void Exception::addCause | ( | const Exception & | cause | ) |
Definition at line 77 of file Exception.cpp.
References causes.
Referenced by Exception(), and digidoc::SignatureBES::validateOffline().
Exception::ExceptionCode Exception::code | ( | ) | const |
Definition at line 65 of file Exception.cpp.
References m_code.
Referenced by setCode().
int Exception::ddoc | ( | ) | const |
Exception::Causes Exception::getCauses | ( | ) | const |
Returns exception causes (other exceptions that caused this exception).
Definition at line 90 of file Exception.cpp.
References causes.
Referenced by getExceptionMsg(), and parseException().
std::string Exception::getMsg | ( | ) | const |
Definition at line 75 of file Exception.cpp.
References msg.
Referenced by getExceptionMsg(), digidoc::DirectoryX509CertStore::loadCerts(), main(), parseException(), testOCSP(), testPKCS11Signer(), testRSASigner(), testSignBDoc(), testTMValidate(), testX509Verify(), and digidoc::XmlConf::XmlConf().
bool Exception::hasCause | ( | ) | const |
Definition at line 82 of file Exception.cpp.
References causes.
Referenced by getExceptionMsg(), and digidoc::SignatureBES::validateOffline().
void Exception::setCode | ( | ExceptionCode | code | ) |
code | set exception code |
Definition at line 95 of file Exception.cpp.
References code(), and m_code.
Referenced by digidoc::EstEIDConsolePinSigner::getPin(), digidoc::SignatureTM::notarize(), digidoc::CNGSigner::sign(), digidoc::PKCS11Signer::sign(), digidoc::SignatureTM::validateOffline(), digidoc::SignatureBES::validateOnline(), and digidoc::OCSP::validateResponse().
void Exception::setDDoc | ( | int | err | ) |
|
protected |
Definition at line 74 of file Exception.h.
Referenced by addCause(), getCauses(), and hasCause().
|
protected |
Definition at line 70 of file Exception.h.
|
protected |
Definition at line 72 of file Exception.h.
Referenced by Exception().
|
protected |
Definition at line 75 of file Exception.h.
|
protected |
Definition at line 73 of file Exception.h.
|
protected |
Definition at line 71 of file Exception.h.
Referenced by getMsg().