diff --git a/lib/remote/configobjectutility.cpp b/lib/remote/configobjectutility.cpp index 13ff4841d..0656aac79 100644 --- a/lib/remote/configobjectutility.cpp +++ b/lib/remote/configobjectutility.cpp @@ -111,8 +111,10 @@ bool ConfigObjectUtility::CreateObject(const Type::Ptr& type, const String& full String path = GetObjectConfigPath(type, fullName); Utility::MkDirP(Utility::DirName(path), 0700); - if (Utility::PathExists(path)) - BOOST_THROW_EXCEPTION(ScriptError("Configuration file '" + path + "' already exists.")); + if (Utility::PathExists(path)) { + errors->Add("Configuration file '" + path + "' already exists."); + return false; + } std::ofstream fp(path.CStr(), std::ofstream::out | std::ostream::trunc); fp << config;