Commits

Nikhil Marathe  committed e2d7a6b

Added error handler and integer reply handler. Inline commands are now automatically generated on load

  • Participants
  • Parent commits 1d30021

Comments (0)

Files changed (1)

 (define (redis:handle-bulk-reply r)
   (list (r 2) (length (r 2))))
 
-(define (redis:bgsave r)
-  (:query r "BGSAVE"))
+(define (redis:handle-error r)
+  (throw-error (1 (chop (r 2) 2))))
+
+(define (redis:handle-integer-reply r)
+  (let (num (int (1 (r 2)))) 
+    (if (nil? num)
+      (throw-error (append "Invalid integer reply:" (r 2)))
+      (list (int num) (length (r 2))))))
+
+(dolist (x redis:inline-commands)
+  (redis:make-inline-command x))
+