Skip to content

Commit

Permalink
Better error messages for delete.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin authored and Trond Norbye committed Oct 29, 2009
1 parent dd599c0 commit ac37e81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion memcached.c
Expand Up @@ -2873,7 +2873,8 @@ static void process_delete_command(conn *c, token_t *tokens, const size_t ntoken

if (ntokens == 4) {
if (!set_noreply_maybe(c, tokens, ntokens)) {
out_string(c, "CLIENT_ERROR bad command line format");
out_string(c, "CLIENT_ERROR bad command line format. "
"Usage: delete <key> [noreply]");
return;
}
}
Expand Down
3 changes: 2 additions & 1 deletion t/issue_3.t
Expand Up @@ -14,7 +14,8 @@ print $sock "delete $key\r\n";
is (scalar <$sock>, "NOT_FOUND\r\n", "not found on delete");

print $sock "delete $key 10\r\n";
is (scalar <$sock>, "CLIENT_ERROR bad command line format\r\n", "invalid delete");
is (scalar <$sock>, "CLIENT_ERROR bad command line format."
. " Usage: delete <key> [noreply]\r\n", "invalid delete");

print $sock "delete $key 10 noreply\r\n";
is (scalar <$sock>, "ERROR\r\n", "Even more invalid delete");
Expand Down

0 comments on commit ac37e81

Please sign in to comment.