forked from Public/pics
Merge pull request 'Replace deprecated trigger_error calls with exceptions' (#52) from trigger-error into master
Reviewed-on: Public/pics#52
This commit is contained in:
@@ -41,13 +41,13 @@ class EditAlbum extends HTMLController
|
||||
exit;
|
||||
}
|
||||
else
|
||||
trigger_error('Cannot delete album: an error occured while processing the request.', E_USER_ERROR);
|
||||
throw new Exception('Cannot delete album: an error occured while processing the request.');
|
||||
}
|
||||
// Editing one, then, surely.
|
||||
else
|
||||
{
|
||||
if ($album->kind !== 'Album')
|
||||
trigger_error('Cannot edit album: not an album.', E_USER_ERROR);
|
||||
throw new Exception('Cannot edit album: not an album.');
|
||||
|
||||
parent::__construct('Edit album \'' . $album->tag . '\'');
|
||||
$form_title = 'Edit album \'' . $album->tag . '\'';
|
||||
|
||||
@@ -39,13 +39,13 @@ class EditTag extends HTMLController
|
||||
exit;
|
||||
}
|
||||
else
|
||||
trigger_error('Cannot delete tag: an error occured while processing the request.', E_USER_ERROR);
|
||||
throw new Exception('Cannot delete tag: an error occured while processing the request.');
|
||||
}
|
||||
// Editing one, then, surely.
|
||||
else
|
||||
{
|
||||
if ($tag->kind === 'Album')
|
||||
trigger_error('Cannot edit tag: is actually an album.', E_USER_ERROR);
|
||||
throw new Exception('Cannot edit tag: is actually an album.');
|
||||
|
||||
parent::__construct('Edit tag \'' . $tag->tag . '\'');
|
||||
$form_title = 'Edit tag \'' . $tag->tag . '\'';
|
||||
|
||||
@@ -33,7 +33,7 @@ class EditUser extends HTMLController
|
||||
{
|
||||
// Don't be stupid.
|
||||
if ($current_user->getUserId() == $id_user)
|
||||
trigger_error('Sorry, I cannot allow you to delete yourself.', E_USER_ERROR);
|
||||
throw new Exception('Sorry, I cannot allow you to delete yourself.');
|
||||
|
||||
// So far so good?
|
||||
$user = Member::fromId($id_user);
|
||||
@@ -43,7 +43,7 @@ class EditUser extends HTMLController
|
||||
exit;
|
||||
}
|
||||
else
|
||||
trigger_error('Cannot delete user: an error occured while processing the request.', E_USER_ERROR);
|
||||
throw new Exception('Cannot delete user: an error occured while processing the request.');
|
||||
}
|
||||
// Editing one, then, surely.
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user