开发者

Rails: errors in production vs development

In Rails, is there a way to display different error messages on a production rails server (a nice graphic) vs a development serve开发者_如何转开发r (detailed error information, stack trace, etc.)?


Found one solution. In ApplicationController, add:

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜