diff options
author | Frédéric Guillot <fred@kanboard.net> | 2018-03-02 15:47:49 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2018-03-02 15:47:49 -0800 |
commit | b4beace91c552a810cdac61e85f4a1b2904f0df2 (patch) | |
tree | 6f234a0474596fee27140ca400e1f8de6f059364 /app/Controller | |
parent | f92eb448cbee45640351c28855045d55ac258590 (diff) |
Display exceptions from plugins while refreshing board
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/BoardAjaxController.php | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/app/Controller/BoardAjaxController.php b/app/Controller/BoardAjaxController.php index ecb76e9c..530056a6 100644 --- a/app/Controller/BoardAjaxController.php +++ b/app/Controller/BoardAjaxController.php @@ -2,6 +2,7 @@ namespace Kanboard\Controller; +use Exception; use Kanboard\Core\Controller\AccessForbiddenException; use Kanboard\Model\UserMetadataModel; @@ -32,18 +33,22 @@ class BoardAjaxController extends BaseController throw new AccessForbiddenException(e("You don't have the permission to move this task")); } - $result =$this->taskPositionModel->movePosition( - $project_id, - $values['task_id'], - $values['dst_column_id'], - $values['position'], - $values['swimlane_id'] - ); - - if (! $result) { - $this->response->status(400); - } else { - $this->response->html($this->renderBoard($project_id), 201); + try { + $result =$this->taskPositionModel->movePosition( + $project_id, + $values['task_id'], + $values['dst_column_id'], + $values['position'], + $values['swimlane_id'] + ); + + if (! $result) { + $this->response->status(400); + } else { + $this->response->html($this->renderBoard($project_id), 201); + } + } catch (Exception $e) { + $this->response->html('<div class="alert alert-error">'.$e->getMessage().'</div>'); } } |