     next: -> throw "Abstract Method"
 
     each: varar(1, 2, (cb, onFinished) ->
+        unless typeof cb is 'function'
+            throw new RqlDriverError "First argument to each must be a function."
+        if onFinished? and typeof onFinished isnt 'function'
+            throw new RqlDriverError "Optional second argument to each must be a function."
+
         brk = false
         n = =>
             if not brk and @hasNext()

        response.__proto__.__index = 0
        response


# API as cursors.
class ArrayResult extends IterableResult
    hasNext: ar () -> (@__index < @.length)
    next: ar (cb) ->
        nextCbCheck(cb)
        cb(null, @[@__proto__.__index++])

    makeIterable: (response) ->
        for name, method of ArrayResult.prototype
