プロジェクト

全般

プロフィール

Vote #78594

完了

Add useful details to error message when a template is missing

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Administration_8
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
8
version_id:
99
issue_org_id:
26341
author_id:
88801
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
3
plus1:
3
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

When a template is missing, this message is added to the logs:

Missing template, responding with 404

We could complete this message with useful details. For instance:

Missing partial issues/_list_simple with {:locale=>[:fr, :en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :rsb]}. Searched in:
  * "/redmine/app/views"

Here is my current patch:


 app/controllers/application_controller.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index a05f54077..a71103a89 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -502,8 +502,8 @@ class ApplicationController < ActionController::Base
   end

   # Handler for ActionView::MissingTemplate exception
-  def missing_template
-    logger.warn "Missing template, responding with 404"
+  def missing_template(exception)
+    logger.warn "Missing template, responding with 404: #{exception}"
     @project = nil
     render_404
   end
--

journals

+1
--------------------------------------------------------------------------------
+ 1. Very useful.
--------------------------------------------------------------------------------
+1
I also suffered from this error when r16401 was committed.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed. Thank you for submitting the patch.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリAdministration_8 にセット
  • 対象バージョン4.0.0_99 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0