Skip to content
Snippets Groups Projects
Commit 09ccfb2b authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6547: YamlParserException: use runtime exceptions

Avoid using stack variables out of their scope
parent cfac94a2
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "yamlnode.h" #include "yamlnode.h"
#include <yaml.h> #include <yaml.h>
#include <stdio.h> #include <stdio.h>
#include <exception> #include <stdexcept>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -45,18 +45,11 @@ namespace Conf ...@@ -45,18 +45,11 @@ namespace Conf
typedef std::vector<yaml_event_t> YamlEventVector; typedef std::vector<yaml_event_t> YamlEventVector;
class YamlParserException : public std::exception class YamlParserException : public std::runtime_error
{ {
public: public:
YamlParserException (const std::string& str="") : errstr ("YamlParserException occured: " + str) {} YamlParserException (const std::string& str="") :
std::runtime_error("YamlParserException occured: " + str) {}
virtual ~YamlParserException() throw() {}
virtual const char *what() const throw() {
return errstr.c_str();
}
private:
std::string errstr;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment