Skip to content

Commit

Permalink
Use exceptions instead of fatalError
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jul 11, 2024
1 parent 8da67c6 commit 9ad23c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion StaticPagesHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function view($args, $request)
// Ensure that if we're previewing, the current user is a manager or admin.
$roles = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_USER_ROLES);
if (!$this->staticPage->getId() && count(array_intersect([Role::ROLE_ID_MANAGER, Role::ROLE_ID_SITE_ADMIN], $roles)) == 0) {
fatalError('The current user is not permitted to preview.');
throw new \Exception('The current user is not permitted to preview.');
}

// Assign the template vars needed and display
Expand Down

0 comments on commit 9ad23c8

Please sign in to comment.