Raise 404 error instead of 500 if permalink access is denied
&& $first->isPrivate()
&& (empty($privateKey) || $privateKey !== $first->getAdditionalContentEntry('private_key'))
) {
- throw new Exception('Not authorized');
+ throw new BookmarkNotFoundException();
}
return $first;
*/
public function testFilterHashPrivateWhileLoggedOut()
{
- $this->expectException(\Exception::class);
- $this->expectExceptionMessage('Not authorized');
+ $this->expectException(BookmarkNotFoundException::class);
+ $this->expectExceptionMessage('The link you are trying to reach does not exist or has been deleted');
$hash = smallHash('20141125_084734' . 6);