diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-11-05 13:38:24 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-11-05 13:38:24 (GMT) |
commit | b3035d83553421e2b919f3f42e67e38eaa7a8523 (patch) | |
tree | 85ed5ad47f7039d89eb32776c3dc8b90a02d2ab3 /src | |
parent | 53bfcdb34d2fa0daefaa67e6de262e69cbedb70f (diff) | |
download | uscxml-b3035d83553421e2b919f3f42e67e38eaa7a8523.zip uscxml-b3035d83553421e2b919f3f42e67e38eaa7a8523.tar.gz uscxml-b3035d83553421e2b919f3f42e67e38eaa7a8523.tar.bz2 |
Better error handling
Diffstat (limited to 'src')
-rw-r--r-- | src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp index d8ea17b..bace24e 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp @@ -201,15 +201,21 @@ void OSGConverter::process(const SendRequest& req) { assert(req.params.find("format") != req.params.end()); std::string source; - if (!Event::getParam(req.params, "source", source)) + if (!Event::getParam(req.params, "source", source)) { reportFailure(req); + LOG(ERROR) << "No source given for convert request"; + return; + } std::string dest; Event::getParam(req.params, "dest", dest); std::string format; - if (!Event::getParam(req.params, "format", format)) + if (!Event::getParam(req.params, "format", format)) { reportFailure(req); + LOG(ERROR) << "No format given for convert request"; + return; + } bool autoRotate = true; if (req.params.find("autorotate") != req.params.end()) { @@ -223,6 +229,7 @@ void OSGConverter::process(const SendRequest& req) { osg::ref_ptr<osg::Node> model = setupGraph(source, autoRotate); if (model->asGroup()->getNumChildren() == 0) { reportFailure(req); + LOG(ERROR) << "Could not setup scenegraph"; return; } @@ -294,6 +301,8 @@ void OSGConverter::process(const SendRequest& req) { if (!osgDB::writeImageFile(*image, tempFile)) { reportFailure(req); + LOG(ERROR) << "Could write image file at " << tempFile; + return; } // read file into buffer |