{"record":{"id":"b57d1b9421814b70","repo":"gollum/gollum","slug":"emoji-name-not-found","errorCode":null,"errorMessage":"emoji `#{name}' not found","messagePattern":"emoji `#(.+?)' not found","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/gollum/helpers.rb","lineNumber":70,"sourceCode":"      halt mustache :error\n    end\n\n    def not_found(msg = nil)\n      @message = msg || \"The requested page does not exist.\"\n      status 404\n      return mustache :error\n    end\n    \n    def not_found_proc\n      not_found_msg = 'Not found.'\n      Proc.new {[404, {'Content-Type' => 'text/html', 'Content-Length' => not_found_msg.length.to_s}, [not_found_msg]]}\n    end\n    \n    def emoji(name)\n      if emoji = Gemojione.index.find_by_name(name)\n        IO.read(EMOJI_PATHNAME.join(\"#{emoji['unicode'].downcase}.png\"))\n      else\n        fail ArgumentError, \"emoji `#{name}' not found\"\n      end\n    end\n  end\nend\n","sourceCodeStart":52,"sourceCodeEnd":75,"githubUrl":"https://github.com/gollum/gollum/blob/d00fefc89be0ab22ab862a51299120a55ccd9280/lib/gollum/helpers.rb#L52-L75","documentation":"helpers#emoji(name) looks the shortname up in the Gemojione index (Gemojione.index.find_by_name) and fails with ArgumentError \"emoji `name' not found\" when the name is unknown. Callers use it to render the PNG for an :emoji: shortname, so any name outside the installed gemojione index crashes the lookup.","triggerScenarios":"emoji(name) with a typo, a vendor-specific shortname like :shipit:, or a name from a newer Unicode/emoji set than the installed gemojione gem supports.","commonSituations":"Upgrading gollum/gemojione where aliases were renamed or dropped; user-authored content using custom emoji names; templates hardcoding shortnames that drift from the index.","solutions":["Correct the shortname - check it resolves: Gemojione.index.find_by_name(name)","Upgrade the gemojione gem to a version whose index includes the emoji","Rescue ArgumentError at the call site and render a fallback (blank image or the raw :name: text)"],"exampleFix":"# before\nemoji(name)\n\n# after\nreturn fallback_image(name) unless Gemojione.index.find_by_name(name)\nemoji(name)","handlingStrategy":"validation","validationCode":"return fallback_image unless Gemojione.index.find_by_name(name)\nemoji(name)","typeGuard":"def known_emoji?(name)\n  !Gemojione.index.find_by_name(name).nil?\nend","tryCatchPattern":"begin\n  emoji(name)\nrescue ArgumentError => e\n  raise unless e.message =~ /emoji `.*' not found/\n  fallback_image(name)\nend","preventionTips":["Check Gemojione.index.find_by_name(name) before rendering :shortnames: from user content","Pin/upgrade the gemojione gem deliberately; alias sets change between versions","Render unknown shortnames as literal text instead of crashing"],"tags":["gollum","emoji","gemojione","argument-error"],"backgroundTag":"unknown-emoji-name","analyzedSha":"d00fefc89be0ab22ab862a51299120a55ccd9280","analyzedAt":"2026-08-21T15:14:18.608Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}