From 7555c2add05a99e3fd4c56a5cc3ad27df8779d98 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Mon, 9 Nov 2015 13:39:14 +0100 Subject: [PATCH] Added a convenience OOM result builder in RestBaseHandler --- arangod/RestHandler/RestBaseHandler.cpp | 7 +++++++ arangod/RestHandler/RestBaseHandler.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/arangod/RestHandler/RestBaseHandler.cpp b/arangod/RestHandler/RestBaseHandler.cpp index 83083b561d..31aca0626f 100644 --- a/arangod/RestHandler/RestBaseHandler.cpp +++ b/arangod/RestHandler/RestBaseHandler.cpp @@ -201,6 +201,13 @@ void RestBaseHandler::generateError (HttpResponse::HttpResponseCode code, int er } } +//////////////////////////////////////////////////////////////////////////////// +/// @brief generates an OUT_OF_MEMORY error +//////////////////////////////////////////////////////////////////////////////// + +void RestBaseHandler::generateOOMError () { + generateError(HttpResponse::SERVER_ERROR, TRI_ERROR_OUT_OF_MEMORY); +} // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE // ----------------------------------------------------------------------------- diff --git a/arangod/RestHandler/RestBaseHandler.h b/arangod/RestHandler/RestBaseHandler.h index 01de14fd04..4e7c9ed21d 100644 --- a/arangod/RestHandler/RestBaseHandler.h +++ b/arangod/RestHandler/RestBaseHandler.h @@ -131,6 +131,12 @@ namespace triagens { int, std::string const&); +//////////////////////////////////////////////////////////////////////////////// +/// @brief generates an OUT_OF_MEMORY error +//////////////////////////////////////////////////////////////////////////////// + + virtual void generateOOMError (); + }; } }