From ab109ab626fff13962368b22c2008bc310a1f67e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 16 Sep 2019 11:37:44 +0200 Subject: [PATCH] SyncruleController: fail nicely in preview fixes #1941 --- application/controllers/SyncruleController.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/controllers/SyncruleController.php b/application/controllers/SyncruleController.php index 2d6c35ab..ec439f14 100644 --- a/application/controllers/SyncruleController.php +++ b/application/controllers/SyncruleController.php @@ -160,7 +160,17 @@ class SyncruleController extends ActionController $this->tabs(new SyncRuleTabs($rule))->activate('preview'); $this->addTitle('Sync Preview'); $sync = new Sync($rule); - $modifications = $sync->getExpectedModifications(); + try { + $modifications = $sync->getExpectedModifications(); + } catch (\Exception $e) { + $this->content()->add( + Html::tag('p', [ + 'class' => 'error' + ], $e->getMessage()) + ); + + return; + } if (empty($modifications)) { $this->content()->add(Html::tag('p', [