if (!$row->id) {
throw new Exception('Issue niet goed opgeslagen.');
}
- $query = $Db->set('comments', [
- 'page' => "{$Page->handler}/{$row->id}",
- 'raw' => $_POST['body'],
- 'message' => messagehtml($_POST['body']),
- 'author' => $User->login,
- ]);
- if (!$query->rowCount()) {
- throw new Exception('Issueinhoud niet opgeslagen.');
+ try {
+ createcomment($_POST, $row);
+ }
+ catch (Exception $e) {
+ throw new Exception("Issueinhoud niet opgeslagen: {$e->getMessage()}.");
}
$_POST = [];
}