From 6e2d55b6d78c53508de47cb38ef30363f9a0377c Mon Sep 17 00:00:00 2001 From: Nick Overdijk Date: Sat, 25 Jun 2011 18:13:10 +0200 Subject: [PATCH] Adds file-is-there check --- Attractor.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Attractor.hpp b/Attractor.hpp index 76cd16d..afb4530 100644 --- a/Attractor.hpp +++ b/Attractor.hpp @@ -2,6 +2,7 @@ #define ATTRACTOR_HPP #include "Logger.hpp" +#include #include #include @@ -17,7 +18,10 @@ public: LogInfo("Reading file '%s'...\n", filename.c_str()); stfu::node system; - system.read(filename.c_str()); + if(!system.read(filename.c_str())){ + std::cerr << "Couldn't open file(" << filename << ") for reading\n"; + exit(-1); + } kernel = AttractorKernel::createAttractorKernel(system.getChild("AttractorKernel")); projector = Projector::createProjector(system.getChild(system.getValue("Projector")), kernel->getDimension());