Null is returned when no action 'OnError' was found

@param $action
@return bool|null
325982
protected function executeOnError($action)
    {
        $action .= 'OnError';
        if ($this->isCallable($this, $action)) {
            $event_name = $this->getModule()->getName().'.'.$this->getName().'.'.$action;
            $result = $this->getEventManager()->dispatchBefore($event_name, $this);

            if ($result !== false) {
                $result = $this->{$action}();
            }

            if ($result !== false) {
                $result = $this->getEventManager()->dispatchAfter($event_name, $this);
            }

            $result = ($result !== false) ? true : $result;
            return $result;
        }
        
        return null;
    }
1208924
public function beforeAction($action)
    {
        if (!parent::beforeAction($action)) {
            return false;
        }
        switch ($action->id) {
        case 'index':
        case 'profile':
        case 'profilePicture':
            if (Yii::$app->user->isGuest) {
                $this->redirect(['login']);

                return false;
            }
            break;
        case 'login':
        case 'recovery':
            if ($action->id === 'recovery' && !$this->module->recoveryEnabled) {
                throw new AccessDeniedHttpException(Yii::t('usr', 'Password recovery has not been enabled.'));
            }
            if (!Yii::$app->user->isGuest) {
                $this->goBack();

                return false;
            }
            break;
        case 'register':
            if (!$this->module->registrationEnabled) {
                throw new AccessDeniedHttpException(Yii::t('usr', 'Registration has not been enabled.'));
            }
            if (!Yii::$app->user->isGuest) {
                $this->redirect(['profile']);

                return false;
            }
            break;
        case 'verify':
            if (!isset($_GET['activationKey'])) {
                throw new BadRequestHttpException(Yii::t('usr', 'Activation key is missing.'));
            }
            break;
        }

        return true;
    }
597713
public function isGranted($action)
    {
        switch ($action) {
            case Constants::ACTION_CREATE:
                $granted = $this->authorizationChecker->isGranted($this->security->getCreate());
                break;
            case Constants::ACTION_UPDATE:
                $granted = $this->authorizationChecker->isGranted($this->security->getEdit());
                break;
            case Constants::ACTION_READ:
                $granted = $this->authorizationChecker->isGranted($this->security->getRead());
                break;
            case Constants::ACTION_DELETE:
                $granted = $this->authorizationChecker->isGranted($this->security->getDelete());
                break;
            case Constants::ACTION_DOWNLOAD:
                $granted = $this->authorizationChecker->isGranted($this->security->getDownload());
                break;
            default:
                $granted = false;
                break;
        }

        return $granted;
    }
353618
public function doAction($action)
    {
        $controller = $this->getOption('hooks-controller');
        $instance = $this->getControllerInstance($controller);

        if (is_object($instance) && method_exists($instance, $action)) {
            $response = call_user_func([$instance, $action]);
        }

        $this->setAction('');

        return isset($response);
    }
1292743
public function isValid($action) {
		$authCtrl=$this->_getAuthController();
		$isValid=$authCtrl->_isValidUser($action);
		if(!$isValid){
			$authCtrl->_autoConnect();
			return $authCtrl->_isValidUser($action);
		}
		return $isValid;
	}
1057216
protected function isActionController($action)
    {
        if ($action instanceof Closure) {
            return false;
        }

        return is_string($action) || is_string(isset($action['uses']) ? $action['uses'] : null);
    }
1237287
public static function isMethod($action) {
        switch (strtoupper($action)) {
        case 'GET':
            return $_SERVER['REQUEST_METHOD'] == 'GET';
        case 'POST':
            return $_SERVER['REQUEST_METHOD'] == 'POST';
        case 'DELETE':
            return $_SERVER['REQUEST_METHOD'] == 'DELETE'
            ?: (isset($_POST['_method']) && $_POST['_method'] == 'DELETE');
        case 'PUT':
            return $_SERVER['REQUEST_METHOD'] == 'PUT'
            ?: (isset($_POST['_method']) && $_POST['_method'] == 'PUT');
        case 'AJAX':
            return static::isAjax();
        case 'wechat':
            return static::isWeChat();
        case 'mobile':
            return static::isMobile();
        }
    }
125908
private function supportsAction($action)
    {
        if (null === $this->getSupportedActions()) {
            return true;
        }

        return in_array($action, $this->getSupportedActions());
    }
645173
private function getActionFromParam($action)
    {
        $action = str_replace("-", "_", $action);
        if (substr($action, -1) === "/") {
            $action = substr($action, 0, -1);
        }

        return lcfirst(Inflector::camelize($action));
    }
263211
public function getSuggestStatus($action)
    {
        if (is_null($this->getOrder())) {
            return;
        }

        $status = $this->getOrderPaymentStatusPaymentValid();
        if (is_null($status)) {
            $status = $this->getStatusByAction($action);
        }

        return $status;
    }
927979
public function Link($action = null)
    {
        $id = $this->element->ID;
        $segment = Controller::join_links('element', $id, $action);
        $page = Director::get_current_page();

        if ($page && !($page instanceof ElementController)) {
            return $page->Link($segment);
        }

        if ($controller = $this->getParentController()) {
            return $controller->Link($segment);
        }

        return $segment;
    }
212190
protected function isActive($action)
    {
        $id = $this->getActionId($action);
        return !in_array($id, $this->except, true) && (empty($this->only) || in_array($id, $this->only, true));
    }
299686
public function httpAction($action)
    {
        $request     = $this->getRequestData();
        $names       = array_reverse(explode('/', $action));
        $namesLength = count($names);
        for ($i = 1; $i < $namesLength; $i++) {
            $names[ $i ][0] = strtoupper($names[ $i ][0]);
        }
        $action     = implode($names);
        $methodName = preg_replace('/[^a-z]+/si', null, $action) . 'Action';
        $result     = $this->{$methodName}($request);

        if (is_array($result)) {
            $serializer = new JsonSerializer();
            $responseBody = $serializer->serialize($result);
            $result     = new Response($responseBody, 200, array('Content-Type' => 'application/json'));
        }

        return $result;
    }
946495
public function Link($action = null)
    {
        return Controller::join_links(
            Director::BaseURL(),
            $this->config()->url_segment,
            $action
        );
    }
1005059
private function isErrorPage(Action $action): bool
    {
        if ($action->getUniqueId() === Yii::$app->getErrorHandler()->errorAction) {
            return true;
        }

        return false;
    }
287438
public function notFound($action = null)
    {
        $methods = array("get", "post", "put", "delete", "ajax", "options", "head", "mobile");
        $route = new Route($methods, '*', $action, 'notFound');
        $this->container->addRoute($route);
        return $route;
    }
87165
public function Link($action = null)
    {
        $curr = Controller::curr();
        if ($this->parentDashboardPage) {
            return Controller::join_links($this->parentDashboardPage->Link(), 'widget', ($this->widget ? $this->widget->ID : null), $action);
        }
        if ($curr != $this) {
            $pageLink = Controller::curr()->Link();
            return Controller::join_links($pageLink, 'widget', ($this->widget ? $this->widget->ID : null), $action);
        }
        
        return Controller::join_links('widget', ($this->widget ? $this->widget->ID : null), $action);
    }