{"record":{"id":"de66aa64c5dc42a9","repo":"redis/redis-rb","slug":"pick-either-count-or-exactly-not-both","errorCode":null,"errorMessage":"Pick either count or exactly, not both","messagePattern":"Pick either count or exactly, not both","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/lists.rb","lineNumber":402,"sourceCode":"      def _bpop(cmd, args, &blk)\n        timeout = if args.last.is_a?(Hash)\n          options = args.pop\n          options[:timeout]\n        end\n\n        timeout ||= 0\n        unless timeout.is_a?(Integer) || timeout.is_a?(Float)\n          raise ArgumentError, \"timeout must be an Integer or Float, got: #{timeout.class}\"\n        end\n\n        args.flatten!(1)\n        command = [cmd].concat(args)\n        command << timeout\n        send_blocking_command(command, timeout, &blk)\n      end\n\n      def _movem_amount_args(count, exactly, order)\n        raise ArgumentError, \"Pick either count or exactly, not both\" if count && exactly\n\n        if count || exactly\n          order = order.to_s.upcase\n          raise ArgumentError, \"order must be 'OBO' or 'BULK'\" if order != \"OBO\" && order != \"BULK\"\n\n          [count ? \"COUNT\" : \"EXACTLY\", Integer(count || exactly), order]\n        elsif order\n          raise ArgumentError, \"order requires count or exactly\"\n        else\n          []\n        end\n      end\n\n      def _normalize_move_wheres(where_source, where_destination)\n        where_source      = where_source.to_s.upcase\n        where_destination = where_destination.to_s.upcase\n\n        if where_source != \"LEFT\" && where_source != \"RIGHT\"","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/lists.rb#L384-L420","documentation":"Error \"Pick either count or exactly, not both\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/lists.rb:402 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either count: or exactly: to the command, not both.","Remove one of the two keyword arguments; use count for an upper bound or exactly for an exact number of elements."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2ba9010b91dab9e0fde1fbae3a9aae003f8bc307","analyzedAt":"2026-08-23T03:54:57.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}