From f278315081b24b59bf73e9613e552e3519200a71 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 28 May 2012 04:39:18 +0000 Subject: Improve error reporting with a reason code. Improve debug and audit logging. Fix test scripts to cleanup state from previous builds and correctly report test errors. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343138 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/components/constdb/tinycdb.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sca-cpp/trunk/components/constdb/tinycdb.hpp') diff --git a/sca-cpp/trunk/components/constdb/tinycdb.hpp b/sca-cpp/trunk/components/constdb/tinycdb.hpp index 02114cf1ae..c7d4cf520b 100644 --- a/sca-cpp/trunk/components/constdb/tinycdb.hpp +++ b/sca-cpp/trunk/components/constdb/tinycdb.hpp @@ -222,7 +222,7 @@ const failable rewrite(const lambda(buffer& buf, const unsi // Open existing db failable ffd = cdbopen(cdb); if (!hasContent(ffd)) - return mkfailure(reason(ffd)); + return mkfailure(ffd); const int fd = content(ffd); // Read the db header @@ -307,7 +307,7 @@ const failable rewrite(const lambda(buffer& buf, const unsi cdbclose(cdb); failable ffd = cdbopen(cdb); if (!hasContent(ffd)) - return mkfailure(reason(ffd)); + return mkfailure(ffd); return true; } @@ -413,7 +413,7 @@ const failable get(const value& key, TinyCDB& cdb) { const failable ffd = cdbopen(cdb); if (!hasContent(ffd)) - return mkfailure(reason(ffd)); + return mkfailure(ffd); const int fd = content(ffd); const string ks(scheme::writeValue(key)); @@ -422,7 +422,7 @@ const failable get(const value& key, TinyCDB& cdb) { if (cdb_seek(fd, c_str(ks), (unsigned int)length(ks), &vlen) <= 0) { ostringstream os; os << "Couldn't get tinycdb entry: " << key; - return mkfailure(str(os)); + return mkfailure(str(os), 404, false); } char* data = gc_cnew(vlen + 1); cdb_bread(fd, data, vlen); -- cgit v1.2.3