Skip to content

Commit

Permalink
Resolved issue #1278
Browse files Browse the repository at this point in the history
  • Loading branch information
rbl219 committed Sep 29, 2015
1 parent 18be3d7 commit d2b4a48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/lib/rest/OrionError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ std::string OrionError::errorStringForV2(const std::string& _reasonPhrase)
{
return "NotFound";
}
else if (_reasonPhrase == "request parameter is invalid/not allowed")
{
return "InvalidParameter";
}




Expand Down
8 changes: 7 additions & 1 deletion src/lib/serviceRoutinesV2/patchEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ std::string patchEntity
// 02. Call standard op postUpdateContext
postUpdateContext(ciP, components, compV, parseDataP);


// 03. Check output from mongoBackend - any errors?
if (parseDataP->upcrs.res.contextElementResponseVector.size() == 1)
{
Expand All @@ -93,6 +92,7 @@ std::string patchEntity
OrionError orionError(SccConflict, "There is more than one entity that match the update. Please refine your query.");
answer = orionError.render(ciP, "");
}

}
}

Expand All @@ -102,6 +102,12 @@ std::string patchEntity
{
ciP->httpStatusCode = SccNoContent;
}
else if (ciP->httpStatusCode == SccInvalidParameter)
{
OrionError orionError(SccInvalidParameter, "request parameter is invalid/not allowed");
answer = orionError.render(ciP, "");
}



// 05. Cleanup and return result
Expand Down

0 comments on commit d2b4a48

Please sign in to comment.