Skip to content
Snippets Groups Projects
Commit 8ed2ab62 authored by Thomas Moulard's avatar Thomas Moulard
Browse files

Enhance run command error message.

parent 24fe1bed
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
/* --- INCLUDE --------------------------------------------------------- */ /* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#include <boost/format.hpp>
/* DYNAMIC-GRAPH */ /* DYNAMIC-GRAPH */
#include <dynamic-graph/interpreter.h> #include <dynamic-graph/interpreter.h>
#include <dynamic-graph/plugin-loader.h> #include <dynamic-graph/plugin-loader.h>
...@@ -285,9 +287,10 @@ cmdRun( const std::string& cmdLine, std::istringstream& cmdArg, std::ostream& os ...@@ -285,9 +287,10 @@ cmdRun( const std::string& cmdLine, std::istringstream& cmdArg, std::ostream& os
ifstream script( filename.c_str(),ios::in ); ifstream script( filename.c_str(),ios::in );
if(! script.is_open() ) if(! script.is_open() )
{ {
DG_THROW ExceptionFactory( ExceptionFactory::READ_FILE, boost::format fmt
"File is not open."," (while reading <%s>).", ("failed to run file ``%1%'' (file does not exist or is not readable).");
filename.c_str() ); fmt % filename;
DG_THROW ExceptionFactory (ExceptionFactory::READ_FILE, fmt.str ());
} }
const int SIZE = 16384; const int SIZE = 16384;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment