水豚服务器&浏览器错误,服务器上无跟踪 [英] Capybara server & browser error with no trace on server

查看:75
本文介绍了水豚服务器&浏览器错误,服务器上无跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我的一项黄瓜测试似乎在poltergeist驱动程序和Rails服务器上均失败。

For some reason one of my cucumber tests seem to fail both on the poltergeist driver and from the rails server.

我在浏览器崩溃时获得了完整的跟踪,但是在服务器端却几乎没有。

I am getting a full trace on the browser crash but almost nothing on the server side.

当我打开我刚刚看到的Capybara屏幕截图

When I open the Capybara screenshot I just see


内部服务器错误
未定义方法名称 for nil:NilClass

Internal Server Error undefined method name for nil:NilClass

当我拖尾test.log

When I tail the test.log


在0ms内完成了500个内部服务器错误(Elasticsearch:0.0ms)

Completed 500 Internal Server Error in 0ms (Elasticsearch: 0.0ms)

(且无踪迹)

我已经尝试


  • 设置 config.action_dispatch .show_exceptions = true

  • b 标志(但仅显示Capybara错误的详细跟踪)

  • (我的配置级别已设置为:debug已存在于我的环境文件中)

  • to set config.action_dispatch.show_exceptions = true
  • the b flag (but it's only showing the detailed trace for the Capybara error
  • (my config level is set to :debug already in my environment file)

如何我可以在服务器端获得完整的回溯吗?

How can I get the full backtrace on the server side ?

EDIT


  • Capybara 2.13.0

  • Rails 5.0.2

  • backtrace_silencers中所有评论

推荐答案

我从此答案

所以解决方案是允许在ActionController中抢救异常::基础。在我的环境文件中,我有以下几行令人误解

So the solution was to allow rescuing the exception in ActionController::Base. In my env file I had the following lines that were misleading

# There are two ways to allow Rails to rescue exceptions:
#
# 1) Tag your scenario (or feature) with @allow-rescue
#
# 2) Set the value below to true. Beware that doing this globally is not
# recommended as it will mask a lot of errors for you!
#
ActionController::Base.allow_rescue = false

并通过添加@ allow-rescue标签在 test.log 中显示了更全面的错误跟踪,以及前端错误视图

And by adding the @allow-rescue tag I got more comprehensive error trace showing in my test.log, along with a frontend error view

这篇关于水豚服务器&浏览器错误,服务器上无跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆