I want to display the error notice when a specific rule match when we edit the customer informations on backend. I tried with default \Exception
class or Magento specific but it show the error as text page instead of the red notice usually used.
Ideally, I wish to display the red notice with a custom message (Address street has to be less or equal to 35 characters
).
1 exception(s):
Exception #0 (Exception): Address street has to be less or equal to 35 characters.
Exception #0 (Exception): Address street has to be less or equal to 35 characters.
<pre>#1 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#2 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Customer/Controller/Adminhtml/Index/Save/Interceptor.php:26]
#3 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:107]
#4 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:235]
#5 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#6 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#7 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143]
#8 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#9 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#10 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Customer/Controller/Adminhtml/Index/Save/Interceptor.php:39]
#11 Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:55]
#12 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#13 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#14 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#15 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#16 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:136]
#17 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:257]
#18 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:37]
</pre>
Thanks in advance!
ps: Late merry Christmas and early happy new year!