You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/10/31 22:34:56 UTC

incubator-ponymail git commit: Blame external caller when things go wrong

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 35b62ef65 -> cafa90370


Blame external caller when things go wrong

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/cafa9037
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/cafa9037
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/cafa9037

Branch: refs/heads/master
Commit: cafa90370625e708bcad729c88b623ca8aaf9571
Parents: 35b62ef
Author: Sebb <se...@apache.org>
Authored: Mon Oct 31 22:34:49 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Mon Oct 31 22:34:49 2016 +0000

----------------------------------------------------------------------
 site/api/lib/elastic.lua | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/cafa9037/site/api/lib/elastic.lua
----------------------------------------------------------------------
diff --git a/site/api/lib/elastic.lua b/site/api/lib/elastic.lua
index 1ede7e0..09a8ce8 100644
--- a/site/api/lib/elastic.lua
+++ b/site/api/lib/elastic.lua
@@ -26,9 +26,10 @@ local default_doc = "mbox"
 function checkReturn(code)
     if not code or code ~= 200 then
         if not code or code == "closed" then
-            error("Could not contact database backend!")
+            -- code is called by top-level functions only, so level 3 is the external caller
+            error("Could not contact database backend!", 3)
         else
-            error("Backend Database returned code " .. code .. "!")
+            error("Backend Database returned code " .. code .. "!", 3)
         end
     end
 end