]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_objectstore_tool: Fix errors messages in newer code
authorDavid Zafman <dzafman@redhat.com>
Fri, 5 Dec 2014 01:48:28 +0000 (17:48 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 19:20:58 +0000 (11:20 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit eae7c02fded460f6c8aaf18aa83d2730b89e0eb1)

src/tools/ceph_objectstore_tool.cc

index 6108fdac441d59c9234f34c1e498473f657f91b5..1bb7ba2c33877d90000f8b38e2650abb1d9a4dbc 100644 (file)
@@ -2318,12 +2318,15 @@ int main(int argc, char **argv)
       if (!json_spirit::read(object, v)) {
        lookup_ghobject lookup(object);
        if (action_on_all_objects(fs, lookup, debug)) {
-         throw std::runtime_error(object + " is neither valid json nor an object name");
+         throw std::runtime_error("Internal error");
        } else {
          if (lookup.size() != 1) {
            stringstream ss;
-           ss << "expected a single object named " << object
-              << " but got " << lookup.size() << " instead";
+           if (lookup.size() == 0)
+             ss << objcmd << ": " << cpp_strerror(ENOENT);
+           else
+             ss << "expected a single object named '" << object
+                << "' but got " << lookup.size() << " instead";
            throw std::runtime_error(ss.str());
          }
          pair<coll_t, ghobject_t> found = lookup.pop();