_getUrlRewrite()->getId()) { try { $this->_getUrlRewrite()->delete(); $this->messageManager->addSuccess(__('You deleted the URL rewrite.')); } catch (\Exception $e) { $this->messageManager->addException($e, __('We can\'t delete URL Rewrite right now.')); $this->_redirect('adminhtml/*/edit/', ['id' => $this->_getUrlRewrite()->getId()]); return; } } $this->_redirect('adminhtml/*/'); } }