From f2d6b9585c43ece95faf258c1d619ee8561338c2 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sun, 3 Mar 2013 10:32:04 -0800 Subject: lua: don't decode reply on error Signed-off-by: Noah Watkins --- src/cls/lua/cls_lua_client.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cls/lua/cls_lua_client.cc b/src/cls/lua/cls_lua_client.cc index fef12b2b084..f949d4ccf28 100644 --- a/src/cls/lua/cls_lua_client.cc +++ b/src/cls/lua/cls_lua_client.cc @@ -29,7 +29,15 @@ namespace cls_lua_client { cmd.input = input; ::encode(cmd, inbl); + /* + * TODO: we need to encapsulate the return value as well. for example, + * -ENOTSUPP is returned if the class is not found, but we also return + * -ENOTSUPP if a handler isn't found. In the later case we still get a + * valid reply, in the former not so much. + */ ret = ioctx.exec(oid, "lua", "eval", inbl, outbl); + if (ret < 0) + return ret; try { ::decode(reply, outbl); -- cgit v1.2.1