Skip to content

Commit

Permalink
Merge pull request #10162 from gaurav36/bug-16444-radosgw-error-message
Browse files Browse the repository at this point in the history
rgw: better error message when user has no bucket created yet
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
  • Loading branch information
oritwas committed Jul 23, 2016
2 parents f84be8f + b9a2048 commit 7e87eaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rgw/rgw_admin.cc
Expand Up @@ -4852,7 +4852,11 @@ int main(int argc, char **argv)
string user_str = user_id.to_str();
int ret = store->cls_user_get_header(user_str, &header);
if (ret < 0) {
cerr << "ERROR: can't read user header: " << cpp_strerror(-ret) << std::endl;
if (ret == -ENOENT) { /* in case of ENOENT */
cerr << "User has not been initialized or user does not exist" << std::endl;
} else {
cerr << "ERROR: can't read user: " << cpp_strerror(ret) << std::endl;
}
return -ret;
}

Expand Down

0 comments on commit 7e87eaf

Please sign in to comment.