【问题标题】:Hide error: The website encountered an unexpected error. Please try again later隐藏错误:网站遇到意外错误。请稍后再试
【发布时间】:2017-04-07 13:55:46
【问题描述】:

我一直在浏览器的左下方收到此消息,即使该网站已完全正常工作。这对用户来说有点烦人。我曾尝试使用 css 隐藏它,但似乎不可能。

你们知道如何隐藏错误信息吗?这是日志文件中的错误:

Error: Call to a member function getPlugins() on null in Drupal\feeds\Entity\Feed->preSave() (line 443 of /var/www/html/modules/contrib/feeds/src/Entity/Feed.php) 
#0 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(434): Drupal\feeds\Entity\Feed->preSave(Object(Drupal\feeds\FeedStorage)) 
#1 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(298): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\feeds\Entity\Feed)) 
#2 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(389): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\feeds\Entity\Feed)) 
#3 /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(761): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\feeds\Entity\Feed)) 
#4 /var/www/html/core/lib/Drupal/Core/Entity/Entity.php(364): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\feeds\Entity\Feed)) 
#5 /var/www/html/modules/contrib/feeds/feeds.module(46): Drupal\Core\Entity\Entity->save() 
#6 [internal function]: feeds_cron() 
#7 /var/www/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(391): call_user_func_array('feeds_cron', Array) 
#8 /var/www/html/core/lib/Drupal/Core/Cron.php(223): Drupal\Core\Extension\ModuleHandler->invoke('feeds', 'cron') 
#9 /var/www/html/core/lib/Drupal/Core/Cron.php(122): Drupal\Core\Cron->invokeCronHandlers() 
#10 /var/www/html/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run() 
#11 /var/www/html/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run() 
#12 /var/www/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) 
#13 /var/www/vendor/symfony/http-kernel/HttpKernel.php(84): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent)) 
#14 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse)) 
#15 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse)) 
#16 /var/www/html/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse)) 
#17 {main}.

【问题讨论】:

    标签: drupal entity feed


    【解决方案1】:

    这似乎是一般错误,要修复它,您应该尝试从代码中调试/跟踪问题。我从你的问题中得到的是你想删除这个错误并让它现在出现在用户面前,如果这是在生产环境中你应该禁用到前端的错误报告,这可以在 D8 中通过转到 admin/ config/development/logging 并选择“要显示的错误消息”并保存您的配置。之后,您可以调试和跟踪此错误。

    希望对你有帮助。

    【讨论】:

    • 好像是Feeds模块的问题,但目前还没有修复补丁。我已将“要显示的错误消息”设置为无,但错误仍然出现。
    猜你喜欢
    • 2020-08-02
    • 2020-07-11
    • 2022-07-20
    • 2011-06-11
    • 2019-11-30
    • 2022-06-22
    • 1970-01-01
    • 2022-06-11
    • 1970-01-01
    相关资源
    最近更新 更多