"examples/community/stable_diffusion_ipex.py" did not exist on "86ecd4b795f865b5b615b8c54991c177bb3dbef5"
Commit 11f98f1c authored by Jesse Beder's avatar Jesse Beder
Browse files

(Finally) overrode Exception::what()\n

parent 464bb701
......@@ -2,6 +2,7 @@
#include <exception>
#include <string>
#include <sstream>
namespace YAML
{
......@@ -62,6 +63,11 @@ namespace YAML
Exception(int line_, int column_, const std::string& msg_)
: line(line_), column(column_), msg(msg_) {}
virtual ~Exception() throw() {}
virtual const char *what() const throw() {
std::stringstream output;
output << "Error at line " << line+1 << ", column " << column+1 << ": " << msg;
return output.str().c_str();
}
int line, column;
std::string msg;
......
......@@ -15,7 +15,7 @@ int main(int argc, char **argv)
YAML::Node doc;
parser.GetNextDocument(doc);
} catch(const YAML::Exception& e) {
std::cerr << "Error at line " << e.line << ", col " << e.column << ": " << e.msg << "\n";
std::cerr << e.what() << "\n";
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment