{"record":{"id":"ae7c4fb46255e923","repo":"redis/redis-rb","slug":"name-must-be-an-integer-in-integer-mode-got","errorCode":null,"errorMessage":"#{name} must be an Integer in integer mode, got #{value.class}","messagePattern":"#(.+?) must be an Integer in integer mode, got #(.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/strings.rb","lineNumber":405,"sourceCode":"      end\n\n      # Get the length of the value stored in a key.\n      #\n      # @param [String] key\n      # @return [Integer] the length of the value stored in the key, or 0\n      #   if the key does not exist\n      def strlen(key)\n        send_command([:strlen, key])\n      end\n\n      private\n\n      # INCREX bounds decide whether the increment is applied at all, so a\n      # Float bound in integer mode must raise rather than silently truncate\n      # (`Integer(2.9)` => 2) — mirroring how `by:` selects the mode strictly.\n      def increx_bound(name, value, float_mode)\n        return Float(value) if float_mode\n        raise TypeError, \"#{name} must be an Integer in integer mode, got #{value.class}\" unless value.is_a?(Integer)\n\n        value\n      end\n    end\n  end\nend\n","sourceCodeStart":387,"sourceCodeEnd":412,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/strings.rb#L387-L412","documentation":"Error \"#{name} must be an Integer in integer mode, got #{value.class}\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/strings.rb:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an Integer value for the named field when the command is in integer mode.","Use float mode (by: / BYFLOAT semantics) if the value must be a Float, or coerce with to_i."],"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"}