Leosac
0.8.0
Open Source Access Control
|
An exception class for general API error. More...
#include <ModelException.hpp>
Classes | |
struct | ModelError |
Describes a model error. More... | |
Public Types | |
using | json = nlohmann::json |
Public Member Functions | |
ModelException (const std::string &source_pointer, const std::string &msg) | |
This is an helper constructor that will instanciate a ModelError object from the 2 parameters. More... | |
ModelException (const std::initializer_list< ModelError > &errors) | |
json | json_errors () const |
Format the ModelError object(s). More... | |
const std::vector< ModelError > | errors () const |
Access the vector of errors. More... | |
Public Member Functions inherited from LEOSACException | |
LEOSACException (const std::string &message) | |
virtual | ~LEOSACException () |
virtual const char * | what () const noexcept final |
const Leosac::Tools::Stacktrace & | trace () const |
Get the stacktrace associated with this exception. More... | |
Private Attributes | |
std::vector< ModelError > | errors_ |
Additional Inherited Members | |
Protected Attributes inherited from LEOSACException | |
std::string | message_ |
An exception class for general API error.
The particularity of this class is that it accepts a JSON object as a parameters.
The ModelException accepts ModelException::ModelError objects as parameter.
Definition at line 33 of file ModelException.hpp.
using ModelException::json = nlohmann::json |
Definition at line 36 of file ModelException.hpp.
ModelException::ModelException | ( | const std::string & | source_pointer, |
const std::string & | msg | ||
) |
This is an helper constructor that will instanciate a ModelError object from the 2 parameters.
source_pointer | |
msg |
Definition at line 23 of file ModelException.cpp.
ModelException::ModelException | ( | const std::initializer_list< ModelError > & | errors | ) |
const std::vector< ModelException::ModelError > ModelException::errors | ( | ) | const |
Access the vector of errors.
Can be useful to analyze errors precisely.
Definition at line 57 of file ModelException.cpp.
ModelException::json ModelException::json_errors | ( | ) | const |
Format the ModelError object(s).
Definition at line 43 of file ModelException.cpp.
|
private |
Definition at line 84 of file ModelException.hpp.