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