ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Blame external caller when things go wrong
Date Mon, 31 Oct 2016 22:34:56 GMT
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 <sebb@apache.org>
Authored: Mon Oct 31 22:34:49 2016 +0000
Committer: Sebb <sebb@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


Mime
View raw message