throw if config is bad
authorKevron Rees <tripzero.kev@gmail.com>
Thu, 6 Jun 2013 05:32:58 +0000 (22:32 -0700)
committerKevron Rees <tripzero.kev@gmail.com>
Thu, 6 Jun 2013 05:32:58 +0000 (22:32 -0700)
ambd/pluginloader.cpp

index 4e191be..83c56e0 100644 (file)
@@ -58,6 +58,10 @@ PluginLoader::PluginLoader(string configFile, AbstractRoutingEngine* re, int arg
        json_object *rootobject;
        json_tokener *tokener = json_tokener_new();
        std::string configBuffer = get_file_contents(configFile.c_str());
+       if(configBuffer == "")
+       {
+               throw std::runtime_error("No config or config empty");
+       }
        enum json_tokener_error err;
        do
        {