File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
app/code/Magento/Cron/Model/Config/Backend Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1111 */
1212namespace Magento \Cron \Model \Config \Backend \Product ;
1313
14+ use Magento \Framework \Exception \LocalizedException ;
15+
1416/**
1517 * Cron job Alert configuration
1618 */
1719class Alert extends \Magento \Framework \App \Config \Value
1820{
1921 /**
20- * Cron string path
22+ * Cron string path for product alerts
2123 */
2224 const CRON_STRING_PATH = 'crontab/default/jobs/catalog_product_alert/schedule/cron_expr ' ;
2325
2426 /**
25- * Cron model path
27+ * Cron model path for product alerts
2628 */
2729 const CRON_MODEL_PATH = 'crontab/default/jobs/catalog_product_alert/run/model ' ;
2830
@@ -67,7 +69,7 @@ public function __construct(
6769 * @inheritdoc
6870 *
6971 * @return $this
70- * @throws \Exception
72+ * @throws LocalizedException
7173 */
7274 public function afterSave ()
7375 {
@@ -102,7 +104,7 @@ public function afterSave()
102104 self ::CRON_MODEL_PATH
103105 )->save ();
104106 } catch (\Exception $ e ) {
105- throw new \ Exception (__ ('We can \'t save the cron expression. ' ));
107+ throw new LocalizedException (__ ('We can \'t save the cron expression. ' ));
106108 }
107109
108110 return parent ::afterSave ();
Original file line number Diff line number Diff line change 1111 */
1212namespace Magento \Cron \Model \Config \Backend ;
1313
14+ use Magento \Framework \Exception \LocalizedException ;
15+
1416/**
1517 * Sitemap configuration
1618 */
1719class Sitemap extends \Magento \Framework \App \Config \Value
1820{
1921 /**
20- * Cron string path
22+ * Cron string path for product alerts
2123 */
2224 const CRON_STRING_PATH = 'crontab/default/jobs/sitemap_generate/schedule/cron_expr ' ;
2325
@@ -67,7 +69,7 @@ public function __construct(
6769 * After save handler
6870 *
6971 * @return $this
70- * @throws \Exception
72+ * @throws LocalizedException
7173 */
7274 public function afterSave ()
7375 {
@@ -102,7 +104,7 @@ public function afterSave()
102104 self ::CRON_MODEL_PATH
103105 )->save ();
104106 } catch (\Exception $ e ) {
105- throw new \ Exception (__ ('We can \'t save the cron expression. ' ));
107+ throw new LocalizedException (__ ('We can \'t save the cron expression. ' ));
106108 }
107109 return parent ::afterSave ();
108110 }
You can’t perform that action at this time.
0 commit comments