Added decode error codes and exceptions

This commit is contained in:
Arun M 2017-12-04 13:17:48 +05:30
parent 234411a550
commit 9e69389caf
7 changed files with 131 additions and 18 deletions

View file

@ -21,11 +21,25 @@ enum class AlgorithmFailureSource
{
};
/**
* Decode error conditions
*/
enum class DecodeErrc
{
JsonParseError = 1,
AlgHeaderMiss,
TypHeaderMiss,
TypMismatch,
};
/**
*/
std::error_code make_error_code(AlgorithmErrc err);
/**
*/
std::error_code make_error_code(DecodeErrc err);
} // END namespace jwt
@ -37,6 +51,9 @@ namespace std
{
template <>
struct is_error_code_enum<jwt::AlgorithmErrc> : true_type {};
template <>
struct is_error_code_enum<jwt::DecodeErrc>: true_type {};
}
#include "jwt/impl/error_codes.ipp"