Skip to content

Commit

Permalink
ceph_objectstore_tool: Fix errors messages in newer code
Browse files Browse the repository at this point in the history
Signed-off-by: David Zafman <dzafman@redhat.com>
  • Loading branch information
dzafman authored and ldachary committed Dec 5, 2014
1 parent 32c832f commit eae7c02
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tools/ceph_objectstore_tool.cc
Expand Up @@ -2324,12 +2324,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();
Expand Down

0 comments on commit eae7c02

Please sign in to comment.