@@ -2,7 +2,6 @@ use std::os::raw::c_long;
22use std:: ffi:: CString ;
33
44use crate :: raw;
5- use crate :: error:: Error ;
65use crate :: LogLevel ;
76use crate :: key:: { RedisKey , RedisKeyWritable } ;
87use crate :: { RedisString , RedisError , RedisValue , RedisResult } ;
@@ -37,7 +36,7 @@ impl Context {
3736 let _ = command;
3837 let _ = args;
3938
40- return Err ( RedisError :: String ( "not implemented" ) ) ;
39+ return Err ( RedisError :: Str ( "not implemented" ) ) ;
4140 }
4241
4342 pub fn reply ( & self , r : RedisResult ) -> raw:: Status {
@@ -74,6 +73,11 @@ impl Context {
7473 let msg = CString :: new ( s) . unwrap ( ) ;
7574 raw:: RedisModule_ReplyWithError . unwrap ( ) ( self . ctx , msg. as_ptr ( ) ) . into ( )
7675 }
76+
77+ Err ( RedisError :: Str ( s) ) => unsafe {
78+ let msg = CString :: new ( s) . unwrap ( ) ;
79+ raw:: RedisModule_ReplyWithError . unwrap ( ) ( self . ctx , msg. as_ptr ( ) ) . into ( )
80+ }
7781 }
7882 }
7983
@@ -85,10 +89,3 @@ impl Context {
8589 RedisKeyWritable :: open ( self . ctx , key)
8690 }
8791}
88-
89- fn handle_status ( status : raw:: Status , message : & str ) -> Result < ( ) , Error > {
90- match status {
91- raw:: Status :: Ok => Ok ( ( ) ) ,
92- raw:: Status :: Err => Err ( error ! ( message) ) ,
93- }
94- }
0 commit comments