Update document, comment, file modules to throw exceptions

This commit is contained in:
Kijin Sung 2018-09-05 23:55:50 +09:00
parent 5be05dd875
commit ad00ac800b
11 changed files with 142 additions and 110 deletions

View file

@ -73,7 +73,7 @@ class commentView extends comment
// A message appears if the user is not logged-in
if(!$oMemberModel->isLogged())
{
return $this->stop('msg_not_logged');
throw new Rhymix\Framework\Exceptions\MustLogin;
}
// Create the comment object.
@ -82,12 +82,12 @@ class commentView extends comment
$oComment = $oCommentModel->getComment($comment_srl);
if(!$oComment->isExists())
{
return $this->setError('msg_invalid_request');
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
// Check permissions
if(!$oComment->isAccessible())
{
return $this->setError('msg_not_permitted');
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
// Browser title settings