mirror of https://gitee.com/bigwinds/arangodb
This commit is contained in:
parent
5878d8184e
commit
a3d169eb5f
|
@ -539,9 +539,14 @@ int DumpFeature::runDump(std::string& dbName, std::string& errorMsg) {
|
|||
|
||||
endEncryption(fd);
|
||||
TRI_TRACKED_CLOSE_FILE(fd);
|
||||
} catch (basics::Exception const& ex) {
|
||||
errorMsg = ex.what();
|
||||
return ex.code();
|
||||
} catch (std::exception const& ex) {
|
||||
errorMsg = ex.what();
|
||||
return TRI_ERROR_INTERNAL;
|
||||
} catch (...) {
|
||||
errorMsg = "out of memory";
|
||||
|
||||
return TRI_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
|
|
@ -394,6 +394,12 @@ int RestoreFeature::processInputDirectory(std::string& errorMsg) {
|
|||
} else {
|
||||
encryptionType = "none";
|
||||
}
|
||||
} catch (basics::Exception const& ex) {
|
||||
errorMsg = ex.what();
|
||||
return ex.code();
|
||||
} catch (std::exception const& ex) {
|
||||
errorMsg = ex.what();
|
||||
return TRI_ERROR_INTERNAL;
|
||||
} catch (...) {
|
||||
// file not found etc.
|
||||
}
|
||||
|
|
|
@ -161,9 +161,6 @@ void ShellFeature::start() {
|
|||
ok = shell->jslint(_jslint);
|
||||
break;
|
||||
}
|
||||
} catch (basics::Exception const& ex) {
|
||||
LOG_TOPIC(ERR, arangodb::Logger::FIXME) << "caught exception " << ex.what();
|
||||
ok = false;
|
||||
} catch (std::exception const& ex) {
|
||||
LOG_TOPIC(ERR, arangodb::Logger::FIXME) << "caught exception " << ex.what();
|
||||
ok = false;
|
||||
|
|
|
@ -396,7 +396,11 @@ std::vector<std::string> listFiles(std::string const& directory) {
|
|||
handle = _findfirst(filter.c_str(), &fd);
|
||||
|
||||
if (handle == -1) {
|
||||
return result;
|
||||
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||
int res = TRI_errno();
|
||||
|
||||
std::string message("failed to enumerate files in directory '" + directory + "': " + strerror(res));
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(res, message);
|
||||
}
|
||||
|
||||
do {
|
||||
|
@ -412,7 +416,11 @@ std::vector<std::string> listFiles(std::string const& directory) {
|
|||
DIR* d = opendir(directory.c_str());
|
||||
|
||||
if (d == nullptr) {
|
||||
return result;
|
||||
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||
int res = TRI_errno();
|
||||
|
||||
std::string message("failed to enumerate files in directory '" + directory + "': " + strerror(res));
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(res, message);
|
||||
}
|
||||
|
||||
dirent* de = readdir(d);
|
||||
|
|
Loading…
Reference in New Issue