35#include <spdlog/spdlog.h>
37#include <pdi/pdi_fwd.h>
63 template<
typename S,
typename... Args>
66 m_what{fmt::format(format_str,
std::forward<Args>(args)...)}
75 const char*
what() const noexcept override;
88 template<
typename S,
typename... Args>
102 template<
typename S,
typename... Args>
106 std::ostringstream err_msg;
107 if (!PC_status(tree) && tree.node) {
108 if (tree.node->start_mark.line == tree.node->end_mark.line) {
109 err_msg <<
"Config_error in line " << tree.node->start_mark.line + 1 <<
": ";
111 err_msg <<
"Config_error in lines " << tree.node->start_mark.line + 1 <<
" - " << tree.node->end_mark.line <<
": ";
114 err_msg <<
"Config_error: ";
116 err_msg << fmt::format(format_str, std::forward<Args>(args)...);
117 m_what = err_msg.str();
129 template<
typename S,
typename... Args>
143 template<
typename S,
typename... Args>
157 template<
typename S,
typename... Args>
171 template<
typename S,
typename... Args>
185 template<
typename S,
typename... Args>
199 template<
typename S,
typename... Args>
213 template<
typename S,
typename... Args>
Config_error(const Config_error &)=default
Config_error(Config_error &&)=default
Config_error(PC_tree_t tree, const S &format_str, Args &&... args)
Definition: error.h:103
Error(PDI_status_t errcode)
Creates a PDI error without a message.
PDI_status_t m_status
status of the error
Definition: error.h:46
Error(PDI_status_t errcode, const char *message)
Creates a PDI error.
Error(PDI_status_t errcode, const S &format_str, Args &&... args)
Creates a PDI error.
Definition: error.h:64
const char * what() const noexcept override
std::string m_what
message of the error
Definition: error.h:49
Impl_error(const Impl_error &)=default
Impl_error(Impl_error &&)=default
Impl_error(const S &format_str, Args &&... args)
Definition: error.h:158
Plugin_error(const S &format_str, Args &&... args)
Definition: error.h:144
Plugin_error(Plugin_error &&)=default
Plugin_error(const Plugin_error &)=default
Right_error(Right_error &&)=default
Right_error(const Right_error &)=default
Right_error(const S &format_str, Args &&... args)
Definition: error.h:200
State_error(State_error &&)=default
State_error(const S &format_str, Args &&... args)
Definition: error.h:186
State_error(const State_error &)=default
System_error(const S &format_str, Args &&... args)
Definition: error.h:172
System_error(const System_error &)=default
System_error(System_error &&)=default
Type_error(Type_error &&)=default
Type_error(const Type_error &)=default
Type_error(const S &format_str, Args &&... args)
Definition: error.h:214
Unavailable_error(Unavailable_error &&)=default
Unavailable_error(const Unavailable_error &)=default
Unavailable_error(const S &format_str, Args &&... args)
Definition: error.h:89
Value_error(Value_error &&)=default
Value_error(const Value_error &)=default
Value_error(const S &format_str, Args &&... args)
Definition: error.h:130
PDI_status_t
Error codes of PDI.
Definition: pdi.h:73
@ PDI_UNAVAILABLE
on an input call, no such data is available
Definition: pdi.h:77
@ PDI_ERR_VALUE
A value expression is invalid.
Definition: pdi.h:81
@ PDI_ERR_STATE
A call to a function has been made at a wrong time (e.g.
Definition: pdi.h:91
@ PDI_ERR_CONFIG
The configuration file is invalid.
Definition: pdi.h:79
@ PDI_ERR_TYPE
Invalid type error.
Definition: pdi.h:95
@ PDI_ERR_SYSTEM
A system error occured (OS, etc.)
Definition: pdi.h:87
@ PDI_ERR_IMPL
Implementation limitation (typically an unimplemented feature)
Definition: pdi.h:85
@ PDI_ERR_PLUGIN
Tried to load a non-existing plugin.
Definition: pdi.h:83
@ PDI_ERR_RIGHT
A conflict of onwership over a content has been raised.
Definition: pdi.h:93
Definition: array_datatype.h:38