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,35 @@
|
|||
#ifndef CPP_JWT_EXCEPTIONS_HPP
|
||||
#define CPP_JWT_EXCEPTIONS_HPP
|
||||
|
||||
#include <new>
|
||||
|
||||
namespace jwt {
|
||||
|
||||
/**
|
||||
*/
|
||||
class MemoryAllocationException final: public std::bad_alloc
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Construct MemoryAllocationException from a
|
||||
* string literal.
|
||||
*/
|
||||
template <size_t N>
|
||||
MemoryAllocationException(const char(&msg)[N])
|
||||
: msg_(&msg[0])
|
||||
{
|
||||
}
|
||||
|
||||
virtual const char* what() const noexcept override
|
||||
{
|
||||
return msg_;
|
||||
}
|
||||
|
||||
private:
|
||||
const char* msg_ = nullptr;
|
||||
};
|
||||
|
||||
|
||||
} // END namespace jwt
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue