libcryptosec
SecretSharerException.h
Go to the documentation of this file.
1 #ifndef SECRETSHAREREXCEPTION_H_
2 #define SECRETSHAREREXCEPTION_H_
3 
5 
7 {
8 public:
9  enum ErrorCode
10  {
15  };
17  {
18  this->where = where;
20  }
22  {
23  this->where = where;
24  this->errorCode = errorCode;
25  }
26  virtual ~SecretSharerException() throw () {}
27  virtual std::string getMessage() const
28  {
30  }
31  virtual std::string toString() const
32  {
33  std::string ret;
35  {
36  ret = "SecretSharerException. Called by: " + this->where + ".";
37  }
38  else
39  {
40  ret = "SecretSharerException: " + SecretSharerException::errorCode2Message(this->errorCode) + ". Called by: " + this->where + ".";
41  }
42  return ret;
43  }
45  {
46  return this->errorCode;
47  }
49  {
50  std::string ret;
51  switch (errorCode)
52  {
54  ret = "Unknown error";
55  break;
57  ret = "Internal error";
58  break;
60  ret = "Invalid threshold value";
61  break;
63  ret = "Invalid parts value";
64  break;
65 // case ErrorCode:::
66 // ret = "";
67 // break;
68  }
69  return ret;
70  }
71 protected:
73 };
74 
75 #endif /*SECRETSHAREREXCEPTION_H_*/
virtual std::string getMessage() const
Definition: SecretSharerException.h:27
virtual SecretSharerException::ErrorCode getErrorCode()
Definition: SecretSharerException.h:44
static std::string errorCode2Message(SecretSharerException::ErrorCode errorCode)
Definition: SecretSharerException.h:48
virtual std::string toString() const
Definition: SecretSharerException.h:31
SecretSharerException(SecretSharerException::ErrorCode errorCode, std::string where)
Definition: SecretSharerException.h:21
Definition: LibCryptoSecException.h:8
std::string where
Definition: LibCryptoSecException.h:23
Definition: SecretSharerException.h:12
Definition: SecretSharerException.h:13
SecretSharerException(std::string where)
Definition: SecretSharerException.h:16
Definition: SecretSharerException.h:14
virtual ~SecretSharerException()
Definition: SecretSharerException.h:26
Definition: SecretSharerException.h:11
ErrorCode
Definition: SecretSharerException.h:9
SecretSharerException::ErrorCode errorCode
Definition: SecretSharerException.h:72
Definition: SecretSharerException.h:6