Reference

Guide

$page->isHomeOrErrorPage()

It's often required to check for the home and error page to stop certain actions. That's why there's a shortcut.

$page->isHomeOrErrorPage(): bool