Log in
Factory

UrlRewriteExceptionMessageFactory

Magento\UrlRewrite\Model\Message\UrlRewriteExceptionMessageFactory

What it does

This factory creates user-friendly error messages specifically for URL rewrite exceptions in Magento 2.

When a UrlAlreadyExistsException occurs (duplicate URL conflicts), it transforms the technical exception into a formatted message containing clickable admin URLs that allow administrators to edit the conflicting URL rewrites.

Developers use this to provide actionable feedback when URL conflicts are detected during product, category, or CMS page saves.

Public Methods

  • createMessage()