RegisterAttribute("methods", Attribute_Config);
if (!serializedObject->Contains("configTx"))
- throw invalid_argument("Serialized object must contain a config snapshot.");
+ throw_exception(invalid_argument("Serialized object must contain a config snapshot."));
/* apply config state from the config item/remote update;
* The DynamicObject::Create function takes care of restoring
}
}
- rename(tempFilename.CStr(), filename.CStr());
+ if (rename(tempFilename.CStr(), filename.CStr()) < 0)
+ throw_exception(PosixException("rename() failed", errno));
}
void DynamicObject::RestoreObjects(const String& filename)
}
dictfp.close();
- rename("dictionaries.dump.tmp", "dictionaries.dump");
+ if (rename("dictionaries.dump.tmp", "dictionaries.dump") < 0)
+ throw_exception(PosixException("rename() failed", errno));
String type;
int count;
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0)
- throw PosixException("gettimeofday() failed", errno);
+ throw_exception(PosixException("gettimeofday() failed", errno));
return tv.tv_sec + tv.tv_usec / 1000000.0;
#endif /* _WIN32 */