*/ class MessageController extends Controller { /** * @return string */ public function actionError() { if (($exception = Yii::$app->getErrorHandler()->exception) === null) { $exception = new NotFoundHttpException(Yii::t('yii', 'Page not found.')); } return $exception->getMessage(); } }