DiceKeys Seeded Cryptography Library
exceptions.hpp
1 #pragma once
2 
3 #include <stdexcept>
4 
14 class CryptographicVerificationFailureException: public std::invalid_argument
15 {
16 public:
23  std::invalid_argument(m ? m : "Cryptographic verification failure") {};
24 };
25 
29 class KeyLengthException: public std::invalid_argument
30 {
31 public:
37  KeyLengthException(const char* m = NULL) :
38  std::invalid_argument(m ? m : "Invalid key length") {};
39 };
40 
44 class JsonParsingException: public std::invalid_argument
45 {
46 public:
52  JsonParsingException(const char* m = NULL) :
53  std::invalid_argument(m ? m : "Exception in parsing JSON") {};
54 };
55 
60 class InvalidRecipeJsonException: public std::invalid_argument
61 {
62  public:
68  InvalidRecipeJsonException(const char* m = NULL) :
69  std::invalid_argument(m ? m : "Invalid JSON key recipe") {};
70 };
71 
76 class InvalidRecipeValueException: public std::invalid_argument
77 {
78  public:
84  InvalidRecipeValueException(const char* m = NULL) :
85  std::invalid_argument(m ? m : "Invalid key recipe") {};
86 };
87  // end of Exceptions group
InvalidRecipeJsonException
Thrown when a recipe string is not in valid JSON format and cannot be parsed.
Definition: exceptions.hpp:60
InvalidRecipeValueException::InvalidRecipeValueException
InvalidRecipeValueException(const char *m=NULL)
Construct by throwing, passing an optional exception message.
Definition: exceptions.hpp:84
KeyLengthException
Thrown when a key is specified to be an invalid or incorrect length.
Definition: exceptions.hpp:29
JsonParsingException::JsonParsingException
JsonParsingException(const char *m=NULL)
Construct by throwing, passing an optional exception message.
Definition: exceptions.hpp:52
KeyLengthException::KeyLengthException
KeyLengthException(const char *m=NULL)
Construct by throwing, passing an optional exception message.
Definition: exceptions.hpp:37
JsonParsingException
Thrown when a JSON-string is not valid.
Definition: exceptions.hpp:44
CryptographicVerificationFailureException::CryptographicVerificationFailureException
CryptographicVerificationFailureException(const char *m=NULL)
Construct by throwing, passing an optional exception message.
Definition: exceptions.hpp:22
InvalidRecipeJsonException::InvalidRecipeJsonException
InvalidRecipeJsonException(const char *m=NULL)
Construct by throwing, passing an optional exception message.
Definition: exceptions.hpp:68
CryptographicVerificationFailureException
Thrown when a cryptographic operation fails due to keys or data being corrupted, modified,...
Definition: exceptions.hpp:14
InvalidRecipeValueException
Thrown when a JSON value in the recipe is in an invalid format or contains an invalid value.
Definition: exceptions.hpp:76