diff --git a/arangosh/V8Client/arangodump.cpp b/arangosh/V8Client/arangodump.cpp index 547ee41b72..9c22db4082 100644 --- a/arangosh/V8Client/arangodump.cpp +++ b/arangosh/V8Client/arangodump.cpp @@ -118,6 +118,12 @@ static bool Overwrite = false; static bool Progress = true; +//////////////////////////////////////////////////////////////////////////////// +/// @brief go on even in the face of errors +//////////////////////////////////////////////////////////////////////////////// + +static bool Force = false; + //////////////////////////////////////////////////////////////////////////////// /// @brief save data //////////////////////////////////////////////////////////////////////////////// @@ -177,6 +183,7 @@ static void ParseProgramOptions (int argc, char* argv[]) { ("collection", &Collections, "restrict to collection name (can be specified multiple times)") ("batch-size", &ChunkSize, "maximum size for individual data batches (in bytes)") ("dump-data", &DumpData, "dump collection data") + ("force", &Force, "continue dumping even in the face of some server-side errors") ("include-system-collections", &IncludeSystemCollections, "include system collections") ("output-directory", &OutputDirectory, "output directory") ("overwrite", &Overwrite, "overwrite data in output directory") @@ -385,6 +392,9 @@ static int StartBatch (string& errorMsg) { delete response; } + if (Force) { + return TRI_ERROR_NO_ERROR; + } return TRI_ERROR_INTERNAL; } @@ -930,11 +940,12 @@ int main (int argc, char* argv[]) { if (major < 1 || major > 2 || - (major == 1 && minor < 4) || - (major == 2 && minor > 0)) { + (major == 1 && minor < 4)) { // we can connect to 1.4, 2.0 and higher only cerr << "Got an incompatible server version '" << versionString << "'" << endl; - TRI_EXIT_FUNCTION(EXIT_FAILURE, NULL); + if (! Force) { + TRI_EXIT_FUNCTION(EXIT_FAILURE, NULL); + } } @@ -961,6 +972,9 @@ int main (int argc, char* argv[]) { string errorMsg = ""; int res = StartBatch(errorMsg); + if (res != TRI_ERROR_NO_ERROR && Force) { + res = TRI_ERROR_NO_ERROR; + } if (res == TRI_ERROR_NO_ERROR) { res = RunDump(errorMsg); diff --git a/arangosh/V8Client/arangorestore.cpp b/arangosh/V8Client/arangorestore.cpp index 9e755a6c64..c2ad429520 100644 --- a/arangosh/V8Client/arangorestore.cpp +++ b/arangosh/V8Client/arangorestore.cpp @@ -923,11 +923,12 @@ int main (int argc, char* argv[]) { if (major < 1 || major > 2 || - (major == 1 && minor < 4) || - (major == 2 && minor > 0)) { + (major == 1 && minor < 4)) { // we can connect to 1.4, 2.0 and higher only cerr << "Got an incompatible server version '" << versionString << "'" << endl; - TRI_EXIT_FUNCTION(EXIT_FAILURE, NULL); + if (! Force) { + TRI_EXIT_FUNCTION(EXIT_FAILURE, NULL); + } }