private function registerAssets()
    {
        if ($this->jsNotifier === false) {
            return;
        }

        if (!Yii::$app instanceof \yii\web\Application) {
            return;
        }

        try {
            $view = Yii::$app->getView();
            RavenAsset::register($view);
            $view->registerJs('Raven.config(' . Json::encode($this->publicDsn) . ', ' . Json::encode($this->jsOptions) . ').install();', View::POS_HEAD);
        } catch (Exception $e) {
            // initialize Sentry component even if unable to register the assets
            Yii::error($e->getMessage());
        }
    }