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 11
11
*/
12
12
namespace Magento \Cron \Model \Config \Backend \Product ;
13
13
14
+ use Magento \Framework \Exception \LocalizedException ;
15
+
14
16
/**
15
17
* Cron job Alert configuration
16
18
*/
17
19
class Alert extends \Magento \Framework \App \Config \Value
18
20
{
19
21
/**
20
- * Cron string path
22
+ * Cron string path for product alerts
21
23
*/
22
24
const CRON_STRING_PATH = 'crontab/default/jobs/catalog_product_alert/schedule/cron_expr ' ;
23
25
24
26
/**
25
- * Cron model path
27
+ * Cron model path for product alerts
26
28
*/
27
29
const CRON_MODEL_PATH = 'crontab/default/jobs/catalog_product_alert/run/model ' ;
28
30
@@ -67,7 +69,7 @@ public function __construct(
67
69
* @inheritdoc
68
70
*
69
71
* @return $this
70
- * @throws \Exception
72
+ * @throws LocalizedException
71
73
*/
72
74
public function afterSave ()
73
75
{
@@ -102,7 +104,7 @@ public function afterSave()
102
104
self ::CRON_MODEL_PATH
103
105
)->save ();
104
106
} 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. ' ));
106
108
}
107
109
108
110
return parent ::afterSave ();
Original file line number Diff line number Diff line change 11
11
*/
12
12
namespace Magento \Cron \Model \Config \Backend ;
13
13
14
+ use Magento \Framework \Exception \LocalizedException ;
15
+
14
16
/**
15
17
* Sitemap configuration
16
18
*/
17
19
class Sitemap extends \Magento \Framework \App \Config \Value
18
20
{
19
21
/**
20
- * Cron string path
22
+ * Cron string path for product alerts
21
23
*/
22
24
const CRON_STRING_PATH = 'crontab/default/jobs/sitemap_generate/schedule/cron_expr ' ;
23
25
@@ -67,7 +69,7 @@ public function __construct(
67
69
* After save handler
68
70
*
69
71
* @return $this
70
- * @throws \Exception
72
+ * @throws LocalizedException
71
73
*/
72
74
public function afterSave ()
73
75
{
@@ -102,7 +104,7 @@ public function afterSave()
102
104
self ::CRON_MODEL_PATH
103
105
)->save ();
104
106
} 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. ' ));
106
108
}
107
109
return parent ::afterSave ();
108
110
}
You can’t perform that action at this time.
0 commit comments