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

* #6547: YamlEmitterException: use runtime exceptions

Avoid using stack variables out of their scope
parent 07b3b786
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define __YAMLEMITTER_H__ #define __YAMLEMITTER_H__
#include <yaml.h> #include <yaml.h>
#include <exception> #include <stdexcept>
#include <string> #include <string>
#include "yamlnode.h" #include "yamlnode.h"
...@@ -42,22 +42,11 @@ namespace Conf ...@@ -42,22 +42,11 @@ namespace Conf
#define EMITTER_BUFFERSIZE 65536 #define EMITTER_BUFFERSIZE 65536
#define EMITTER_MAXEVENT 1024 #define EMITTER_MAXEVENT 1024
class YamlEmitterException : public std::exception class YamlEmitterException : public std::runtime_error
{ {
public: public:
YamlEmitterException (const std::string& str="") throw() : errstr (str) {} YamlEmitterException (const std::string& str="") :
std::runtime_error("YamlParserException occured: " + str) {}
virtual ~YamlEmitterException() throw() {}
virtual const char *what() const throw() {
std::string expt ("YamlParserException occured: ");
expt.append (errstr);
return expt.c_str();
}
private:
std::string errstr;
}; };
class YamlEmitter class YamlEmitter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment