47 #ifndef FLATLAND_SERVER_EXCEPTIONS_H 48 #define FLATLAND_SERVER_EXCEPTIONS_H 50 #include <yaml-cpp/yaml.h> 51 #include <boost/filesystem.hpp> 62 Exception(
const std::string &msg) : runtime_error(msg) {}
78 static const std::string ErrorMsg(
const std::string &msg) {
79 std::stringstream output;
80 output <<
"Flatland plugin: ";
95 const YAML::Exception &yaml_cpp_exception)
97 ErrorMsg(msg, yaml_cpp_exception.msg, yaml_cpp_exception.mark)) {}
113 static const std::string ErrorMsg(
const std::string &msg,
114 const std::string &yaml_cpp_msg,
115 const YAML::Mark &yaml_cpp_mark) {
116 std::stringstream output;
118 output <<
"Flatland YAML: ";
120 if (!(yaml_cpp_mark.pos == -1 && yaml_cpp_mark.line == -1 &&
121 yaml_cpp_mark.column == -1)) {
122 output <<
", line " << yaml_cpp_mark.line + 1 <<
" col " 123 << yaml_cpp_mark.column + 1;
126 if (yaml_cpp_msg.size() > 0) {
127 output <<
", " << yaml_cpp_msg;
135 #endif // FLATLAND_SERVER_WORLD_H Exception(const std::string &msg)
Constructor for the Exception class.
Definition: exceptions.h:62
YAMLException(const std::string &msg)
Constructor for the YAMLException class, stores and generates exception message using just a message...
Definition: exceptions.h:104
Definition: exceptions.h:57
PluginException(const std::string &msg)
Constructor for PluginException.
Definition: exceptions.h:71
Definition: exceptions.h:86
YAMLException(const std::string &msg, const YAML::Exception &yaml_cpp_exception)
Constructor for the YAMLException class, stores and generates exception message using yaml cpp except...
Definition: exceptions.h:94
Definition: exceptions.h:65