mirror of https://gitee.com/bigwinds/arangodb
improved error messages, generate empty data file for dump-data=false
This commit is contained in:
parent
603612f1d2
commit
66fd2425a4
|
@ -237,7 +237,8 @@ arangodb::Result dumpJsonObjects(arangodb::DumpFeature::JobData& jobData,
|
|||
file.write(result->c_str(), result->length());
|
||||
|
||||
if (file.status().fail()) {
|
||||
return {TRI_ERROR_CANNOT_WRITE_FILE};
|
||||
return {TRI_ERROR_CANNOT_WRITE_FILE, std::string("cannot write file '") + file.path() +
|
||||
"': " + file.status().errorMessage()};
|
||||
}
|
||||
|
||||
jobData.stats.totalWritten += static_cast<uint64_t>(result->length());
|
||||
|
@ -476,15 +477,16 @@ arangodb::Result processJob(arangodb::httpclient::SimpleHttpClient& client,
|
|||
dumpData = jobData.maskings->shouldDumpData(jobData.name);
|
||||
}
|
||||
|
||||
if (dumpData) {
|
||||
// save the actual data
|
||||
auto file = jobData.directory.writableFile(jobData.name + "_" +
|
||||
hexString + ".data.json",
|
||||
// always create the file so that arangorestore does not complain
|
||||
auto file = jobData.directory.writableFile(jobData.name + "_" + hexString +
|
||||
".data.json",
|
||||
true);
|
||||
if (!::fileOk(file.get())) {
|
||||
return ::fileError(file.get(), true);
|
||||
}
|
||||
|
||||
if (dumpData) {
|
||||
// save the actual data
|
||||
if (jobData.options.clusterMode) {
|
||||
result = ::handleCollectionCluster(client, jobData, *file);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue