Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
06a24b9c
Unverified
Commit
06a24b9c
authored
Nov 19, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Nov 19, 2019
Browse files
Merge pull request #6597 from yossigo/rm-call-extended-errors
Improve RM_Call() errno classification.
parents
8e950644
2d1e893b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
06a24b9c
...
...
@@ -3121,7 +3121,9 @@ fmterr:
* On success a RedisModuleCallReply object is returned, otherwise
* NULL is returned and errno is set to the following values:
*
* EINVAL: command non existing, wrong arity, wrong format specifier.
* EBADF: wrong format specifier.
* EINVAL: wrong command arity.
* ENOENT: command does not exist.
* EPERM: operation in Cluster instance with key in non local slot.
*
* This API is documented here: https://redis.io/topics/modules-intro
...
...
@@ -3153,7 +3155,7 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch
/* We handle the above format error only when the client is setup so that
* we can free it normally. */
if
(
argv
==
NULL
)
{
errno
=
E
INVAL
;
errno
=
E
BADF
;
goto
cleanup
;
}
...
...
@@ -3165,7 +3167,7 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch
*/
cmd
=
lookupCommand
(
c
->
argv
[
0
]
->
ptr
);
if
(
!
cmd
)
{
errno
=
E
INVAL
;
errno
=
E
NOENT
;
goto
cleanup
;
}
c
->
cmd
=
c
->
lastcmd
=
cmd
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment