public function onDispatchError(MvcEvent $e)
    {
        $ex = $e->getParam('exception');
        $model = $e->getResult();

        if ($model instanceof ViewModel
            && Application::ERROR_EXCEPTION == $e->getError()
            && 0 === strpos($ex->getMessage(), 'Your application id and secret')
        ) {
            $model->setTemplate('auth/error/social-profiles-unconfigured');
        }
    }