Replace deprecated trigger_error calls with exceptions

This commit is contained in:
2025-02-13 11:37:55 +01:00
parent 814a1f82f6
commit 85ed6ba8d3
7 changed files with 26 additions and 26 deletions

View File

@@ -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