{"record":{"id":"b6ec0f7c56e22b1f","repo":"ruby/rubygems","slug":"expected-cooldown-to-be-a-non-negative-integer-b6ec0f","errorCode":null,"errorMessage":"Expected `cooldown` to be a non-negative integer, got #{cooldown.inspect}","messagePattern":"Expected `cooldown` to be a non-negative integer, got #(.+?)","errorType":"exception","errorClass":"InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/dsl.rb","lineNumber":122,"sourceCode":"      add_dependency(name, version, options)\n    end\n\n    # For usage in Dsl.evaluate, since lockfile is used as part of the Gemfile.\n    def lockfile_path\n      @lockfile\n    end\n\n    def lockfile(file)\n      @lockfile = file\n    end\n\n    def source(source, *args, &blk)\n      options = args.last.is_a?(Hash) ? args.pop.dup : {}\n      options = normalize_hash(options)\n      source = normalize_source(source)\n      cooldown = options[\"cooldown\"]\n      if cooldown && !(cooldown.is_a?(Integer) && cooldown >= 0)\n        raise InvalidOption, \"Expected `cooldown` to be a non-negative integer, got #{cooldown.inspect}\"\n      end\n\n      if options.key?(\"type\")\n        options[\"type\"] = options[\"type\"].to_s\n        unless (source_plugin = Plugin.source_plugin(options[\"type\"]))\n          raise InvalidOption, \"No plugin sources available for #{options[\"type\"]}\"\n        end\n        # Implicitly add a dependency on source plugins who are named bundler-source-<type>,\n        # and aren't already mentioned in the Gemfile.\n        # See also Plugin::DSL#source\n        if source_plugin.start_with?(\"bundler-source-\") && !@dependencies.any? {|d| d.name == source_plugin }\n          plugin(source_plugin)\n        end\n\n        unless block_given?\n          raise InvalidOption, \"You need to pass a block to #source with :type option\"\n        end\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/dsl.rb#L104-L140","documentation":"Error \"Expected `cooldown` to be a non-negative integer, got #{cooldown.inspect}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/dsl.rb:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}