////////////////////////////////////////////////////////////\r
#include <Pluma/Host.hpp>\r
#include <cstdio>\r
+#include <stdexcept>\r
\r
\r
namespace pluma{\r
////////////////////////////////////////////////////////////\r
bool Host::add(Provider* provider){\r
if (provider == NULL){\r
- fprintf(stderr, "Trying to add a null provider.\n");\r
+ //fprintf(stderr, "Trying to add a null provider.\n");\r
+ throw std::runtime_error( "Trying to add a null provider." );\r
return false;\r
}\r
if (!validateProvider(provider)){\r
bool Host::validateProvider(Provider* provider) const{\r
const std::string& type = provider->plumaGetType();\r
if ( !knows(type) ){\r
- fprintf(stderr, "%s provider type isn't registered.\n", type.c_str());\r
+ // fprintf(stderr, "%s provider type isn't registered.\n", type.c_str());\r
+ throw std::runtime_error(\r
+ type + std::string( " provider type isn't registered." )\r
+ );\r
return false;\r
}\r
if (!provider->isCompatible(*this)){\r
- fprintf(stderr, "Incompatible %s provider version.\n", type.c_str());\r
+ // fprintf(stderr, "Incompatible %s provider version.\n", type.c_str());\r
+ throw std::runtime_error(\r
+ std::string( "Incompatible " ) +\r
+ type +\r
+ std::string( " provider version." )\r
+ );\r
return false;\r
}\r
return true;\r