1
0
Fork 0

fixed [] attribute access

This commit is contained in:
Jan Steemann 2014-08-12 14:02:46 +02:00
parent 162681ada4
commit 7feea4c640
3 changed files with 13 additions and 9 deletions

View File

@ -189,12 +189,11 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
ExecutionBlock* operator[] (size_t pos) {
if (pos > _dependencies.size()) {
if (pos >= _dependencies.size()) {
return nullptr;
}
else {
return _dependencies.at(pos);
}
return _dependencies.at(pos);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -172,12 +172,11 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
ExecutionNode* operator[] (size_t pos) const {
if (pos > _dependencies.size()) {
if (pos >= _dependencies.size()) {
return nullptr;
}
else {
return _dependencies.at(pos);
}
return _dependencies.at(pos);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -238,9 +238,15 @@ QueryResult Query::execute () {
catch (triagens::arango::Exception const& ex) {
return QueryResult(ex.code(), ex.message());
}
catch (...) {
catch (std::bad_alloc const& ex) {
return QueryResult(TRI_ERROR_OUT_OF_MEMORY, TRI_errno_string(TRI_ERROR_OUT_OF_MEMORY));
}
catch (std::exception const& ex) {
return QueryResult(TRI_ERROR_INTERNAL, ex.what());
}
catch (...) {
return QueryResult(TRI_ERROR_INTERNAL, TRI_errno_string(TRI_ERROR_INTERNAL));
}
}
////////////////////////////////////////////////////////////////////////////////