{"record":{"id":"bb247d6c13e662b6","repo":"symfony/symfony","slug":"the-emoji-catalog-s-is-not-available","errorCode":null,"errorMessage":"The emoji catalog \"%s\" is not available.","messagePattern":"The emoji catalog \"(.+?)\" is not available\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Bridge/Twig/Extension/EmojiExtension.php","lineNumber":50,"sourceCode":"\n    public function getFilters(): array\n    {\n        return [\n            new TwigFilter('emojify', $this->emojify(...)),\n        ];\n    }\n\n    /**\n     * Converts emoji short code (:wave:) to real emoji (👋).\n     */\n    public function emojify(string $string, ?string $catalog = null): string\n    {\n        $catalog ??= $this->defaultCatalog;\n\n        try {\n            $tr = self::$transliterators[$catalog] ??= EmojiTransliterator::create($catalog, EmojiTransliterator::REVERSE);\n        } catch (\\IntlException $e) {\n            throw new \\LogicException(\\sprintf('The emoji catalog \"%s\" is not available.', $catalog), previous: $e);\n        }\n\n        return (string) $tr->transliterate($string);\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":56,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Bridge/Twig/Extension/EmojiExtension.php#L32-L56","documentation":"EmojiExtension::emojify() calls EmojiTransliterator::create($catalog) which relies on ICU transliteration data. If the catalog name is unknown or ICU cannot provide it, an IntlException is thrown and rewrapped as a LogicException naming the unavailable catalog.","triggerScenarios":"Calling the `emojify` filter (or EmojiExtension::emojify()) with a `$catalog` argument that does not correspond to a known emoji catalog; relying on the default catalog when the ICU data files for that catalog are missing on the system.","commonSituations":"Passing a typo'd or custom catalog name; deploying to a minimal container/OS image whose libicu lacks the emoji transliteration data; mismatch between the symfony/emoji data version and the installed ICU version.","solutions":["Use a known/valid catalog name (the default is 'text'); check the symfony/emoji documentation for the list of bundled catalogs.","Ensure the runtime has a sufficiently complete ICU installation: install/upgrade the `intl` and ICU packages for your PHP build.","Catch the LogicException and fall back to the un-emojified string if emoji rendering is non-critical.","Update symfony/emoji to a version whose catalog data matches your ICU runtime."],"exampleFix":"// before\n$out = $ext->emojify($text, 'mycatalog'); // unknown catalog -> throws\n\n// after — use a valid catalog or fall back\ntry {\n    $out = $ext->emojify($text, 'text');\n} catch (\\LogicException $e) {\n    $out = $text; // graceful fallback\n}","handlingStrategy":"try-catch","validationCode":"// Validate a catalog before passing it to emojify\n$valid = in_array($catalog, ['text'], true); // extend with known catalogs\nif (!$valid) {\n    // fall back to default or skip emojification\n}","typeGuard":null,"tryCatchPattern":"try {\n    $out = $ext->emojify($text, $catalog);\n} catch (\\LogicException $e) {\n    $out = $text; // graceful fallback to the original string\n}","preventionTips":["Use only documented emoji catalog names; the default is 'text'.","Ensure the runtime has a complete ICU installation (intl extension + libicu data).","Catch LogicException and fall back to the raw string when emoji rendering is non-critical.","Keep symfony/emoji and the system ICU version aligned."],"tags":["twig","emoji","intl","icu","templating"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}