{"record":{"id":"037a318ab2ad06c7","repo":"deivid-rodriguez/byebug","slug":"missed-argument-key-for-string","errorCode":null,"errorMessage":"Missed argument #{key} for '#{string}'","messagePattern":"Missed argument #(.+?) for '#(.+?)'","errorType":"exception","errorClass":"Byebug::Printers::Base::MissedArgument","httpStatus":null,"severity":"error","filePath":"lib/byebug/printers/base.rb","lineNumber":39,"sourceCode":"\n      def locate(path)\n        result = nil\n        contents.each_value do |contents|\n          result = parts(path).reduce(contents) do |r, part|\n            r&.key?(part) ? r[part] : nil\n          end\n          break if result\n        end\n        raise MissedPath, \"Can't find part path '#{path}'\" unless result\n\n        result\n      end\n\n      def translate(string, args = {})\n        # they may contain #{} string interpolation\n        string.gsub(/\\|\\w+$/, \"\").gsub(/([^#]?){([^}]*)}/) do\n          key = Regexp.last_match[2].to_s\n          raise MissedArgument, \"Missed argument #{key} for '#{string}'\" unless args.key?(key.to_sym)\n\n          \"#{Regexp.last_match[1]}#{args[key.to_sym]}\"\n        end\n      end\n\n      def parts(path)\n        path.split(SEPARATOR)\n      end\n\n      def contents\n        @contents ||= contents_files.each_with_object({}) do |filename, hash|\n          hash[filename] = YAML.load_file(filename) || {}\n        end\n      end\n\n      def array_of_args(collection, &_block)\n        collection_with_index = collection.each.with_index\n        collection_with_index.each_with_object([]) do |(item, index), array|","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/deivid-rodriguez/byebug/blob/25476b18d97172fecd61056d36255f311aa4a73c/lib/byebug/printers/base.rb#L21-L57","documentation":"Error \"Missed argument #{key} for '#{string}'\" thrown in deivid-rodriguez/byebug.","triggerScenarios":"Thrown at lib/byebug/printers/base.rb:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass every {placeholder} used in the template string as a symbol key in the args hash to translate/print.","Fix the template to remove or rename placeholders that have no matching argument."],"exampleFix":"translate('Line {line}', { line: 5 })   # provide :line so {line} can be substituted","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"25476b18d97172fecd61056d36255f311aa4a73c","analyzedAt":"2026-08-23T12:31:57.934Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}