[英]Rails: errors in production vs development
在Rails中,有没有一种方法可以在生产Rails服务器(漂亮的图形)和开发服务器上显示不同的错误消息(详细的错误信息,堆栈跟踪等)?
Found one solution . 找到了一种解决方案 。 In ApplicationController, add:
在ApplicationController中,添加:
rescue_from Exception, :with => :rescue_all_exceptions if RAILS_ENV == 'production'
def rescue_all_exceptions(exception)
case exception
# do production-ey exception stuff
end
end
I'd be interested to hear other options... 我想听听其他选择...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.