Skip to content
Snippets Groups Projects
Unverified Commit 56ad4cdf authored by Vincent Petry's avatar Vincent Petry
Browse files

Show error message when posting an invalid comment

When an internal server error occurs while creating or updating a
comment, display a proper error notification in the UI.
parent 29068d38
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -185,7 +185,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
$msg = 'Message exceeds allowed character limit of ';
throw new BadRequest($msg . IComment::MAX_MESSAGE_LENGTH, 0, $e);
}
return false;
throw $e;
}
}
......
......@@ -166,6 +166,10 @@ class CommentsNodeTest extends \Test\TestCase {
$this->assertTrue($this->node->updateComment($msg));
}
/**
* @expectedException Exception
* @expectedExceptionMessage buh!
*/
public function testUpdateCommentLogException() {
$msg = null;
......@@ -198,7 +202,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this->logger->expects($this->once())
->method('logException');
$this->assertFalse($this->node->updateComment($msg));
$this->node->updateComment($msg);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment