Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Retry.php
Go to the documentation of this file.
1 <?php
8 
15 
19 class Retry extends Action
20 {
26  private $subscriptionHandler;
27 
31  const ADMIN_RESOURCE = 'Magento_Analytics::analytics_settings';
32 
37  public function __construct(
38  Context $context,
39  SubscriptionHandler $subscriptionHandler
40  ) {
41  $this->subscriptionHandler = $subscriptionHandler;
42  parent::__construct($context);
43  }
44 
50  public function execute()
51  {
53  $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
54  try {
55  $resultRedirect->setPath('adminhtml');
56  $this->subscriptionHandler->processEnabled();
57  } catch (LocalizedException $e) {
58  $this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
59  } catch (\Exception $e) {
60  $this->getMessageManager()->addExceptionMessage(
61  $e,
62  __('Sorry, there has been an error processing your request. Please try again later.')
63  );
64  }
65 
66  return $resultRedirect;
67  }
68 }
__()
Definition: __.php:13
__construct(Context $context, SubscriptionHandler $subscriptionHandler)
Definition: Retry.php:37