mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 01:08:31 +00:00
Add error codes for signing error checks
This commit is contained in:
parent
2290c8733a
commit
53a281640f
6 changed files with 275 additions and 70 deletions
|
@ -0,0 +1,44 @@
|
|||
#ifndef CPP_JWT_ERROR_CODES_HPP
|
||||
#define CPP_JWT_ERROR_CODES_HPP
|
||||
|
||||
#include <system_error>
|
||||
|
||||
namespace jwt {
|
||||
/**
|
||||
* All the algorithm errors
|
||||
*/
|
||||
enum class AlgorithmErrc
|
||||
{
|
||||
SigningErr = 1,
|
||||
VerificationErr,
|
||||
NoneAlgorithmUsed, // Not an actual error!
|
||||
};
|
||||
|
||||
/**
|
||||
* Algorithm error conditions
|
||||
*/
|
||||
enum class AlgorithmFailureSource
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
std::error_code make_error_code(AlgorithmErrc err);
|
||||
|
||||
} // END namespace jwt
|
||||
|
||||
|
||||
/**
|
||||
* Make the custom enum classes as error code
|
||||
* adaptable.
|
||||
*/
|
||||
namespace std
|
||||
{
|
||||
template <>
|
||||
struct is_error_code_enum<jwt::AlgorithmErrc> : true_type {};
|
||||
}
|
||||
|
||||
#include "jwt/impl/error_codes.ipp"
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue