跳到內容 跳到搜尋

Action Controller Rescue

此模組負責提供 rescue_from 給控制器,包裝動作來處理已設定的錯誤,並設定詳細例外情況顯示的時機。

方法
S
包含的模組

執行個體公開的方法

show_detailed_exceptions?()

如果您想要自訂詳細例外情況顯示的時機,請覆寫此方法。此方法只有在 consider_all_requests_localfalse 時才會被呼叫。預設它會傳回 false,但有人可能會將它設定為 request.local?,讓生產環境中的本機要求仍顯示詳細例外情況頁面。

# File actionpack/lib/action_controller/metal/rescue.rb, line 21
def show_detailed_exceptions?
  false
end