libdigidocpp
4.0.0
|
Base exception class of the digidoc implementation. More...
#include <Exception.h>
Public Types | |
enum | ExceptionCode { General = 0 , NetworkError = 20 , HostNotFound = 101 , InvalidUrl = 102 , CertificateIssuerMissing = 10 , CertificateRevoked = 5 , CertificateUnknown = 6 , OCSPBeforeTimeStamp = 19 , OCSPResponderMissing = 8 , OCSPCertMissing = 9 , OCSPTimeSlot = 7 , OCSPRequestUnauthorized = 11 , TSForbidden = 21 , TSTooManyRequests = 18 , PINCanceled = 2 , PINFailed = 4 , PINIncorrect = 1 , PINLocked = 3 , ReferenceDigestWeak = 12 , SignatureDigestWeak = 13 , DataFileNameSpaceWarning = 14 , IssuerNameSpaceWarning = 15 , ProducedATLateWarning = 16 , MimeTypeWarning = 17 , DDocError = 512 } |
using | Causes = std::vector< Exception > |
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) | |
Exception (const Exception &other) | |
Exception (Exception &&other) noexcept | |
virtual | ~Exception () |
Exception & | operator= (const Exception &other) |
Exception & | operator= (Exception &&other) noexcept |
std::string | file () const |
int | line () const |
ExceptionCode | code () const |
std::string | msg () const |
Causes | causes () const |
void | addCause (const Exception &cause) |
void | setCode (ExceptionCode Code) |
Static Public Member Functions | |
static void | addWarningIgnore (ExceptionCode code) |
static void | setWarningIgnoreList (const std::vector< ExceptionCode > &list) |
static bool | hasWarningIgnore (ExceptionCode code) |
Base exception class of the digidoc implementation.
using digidoc::Exception::Causes = std::vector<Exception> |
Exception code
Enumerator | |
---|---|
General | General error, no specific code |
NetworkError | Network error, network connection errors |
HostNotFound | Network error, host not found |
InvalidUrl | Network error, invalid URL |
CertificateIssuerMissing | Signer's certificate's issuer certificate is missing |
CertificateRevoked | Certificate status is revoked in OCSP response |
CertificateUnknown | Certificate status is unknown in OCSP response |
OCSPBeforeTimeStamp | OCSP producedAt time is before TimeStamp time |
OCSPResponderMissing | OCSP Responder is missing |
OCSPCertMissing | OCSP Responder certificate is missing |
OCSPTimeSlot | OCSP Response is not in valid time slot |
OCSPRequestUnauthorized | OCSP Responder requires the OCSP request to be signed |
TSForbidden | TSA service responds forbidden |
TSTooManyRequests | TSA service requests have reached limit |
PINCanceled | PIN cancelled exception |
PINFailed | PIN verification error |
PINIncorrect | PIN incorrect error |
PINLocked | PIN locked error |
ReferenceDigestWeak | One or more referenced objects in container are calculated by using weaker digest method that recommended |
SignatureDigestWeak | The digest that is signed in container has been calculated by using weaker digest method than recommended |
DataFileNameSpaceWarning | DDoc warning: <DataFile> XML element is missing xmlns attribute |
IssuerNameSpaceWarning | DDoc warning: <X509IssuerName> and/or <X509IssuerSerial> XML element is missing xmlns attribute |
ProducedATLateWarning | TimeStamp and OCSP time difference is more than 15 minutes |
MimeTypeWarning | Mime type is not conformant mime-type strings |
DDocError | DDoc libdigidoc error codes bit masked
|
Exception::Exception | ( | const std::string & | file, |
int | line, | ||
const std::string & | msg | ||
) |
file | source file name, where the exception was thrown. |
line | line of the file, where the exception was thrown. |
msg | error message. |
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 | source file name, where the exception was thrown. |
line | line of the file, where the exception was thrown. |
msg | error message. |
cause | cause of the exception. |
References addCause().
|
default |
Copy constructor
|
defaultnoexcept |
Move constructor
|
virtualdefault |
Releases memory
void Exception::addCause | ( | const Exception & | cause | ) |
Adds child Exception
Referenced by Exception().
|
static |
Ignore Warning exceptions globaly
code | Push additional exception to list |
References code().
Exception::Causes Exception::causes | ( | ) | const |
Returns exception causes (other exceptions that caused this exception).
Exception::ExceptionCode Exception::code | ( | ) | const |
Returns exception code
Referenced by addWarningIgnore(), hasWarningIgnore(), and setCode().
string Exception::file | ( | ) | const |
Returns exception file
|
static |
Verifies if Warning exception is in igonre list
References code().
int Exception::line | ( | ) | const |
Returns exception line
string Exception::msg | ( | ) | const |
Returns error message.
void Exception::setCode | ( | ExceptionCode | code | ) |
|
static |
Ignore Warning exceptions globaly
list | Set new exception list |