Patch #26341

Add useful details to error message when a template is missing

Added by Vincent Robert 7 months ago. Updated 8 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:


Target version:4.0.0


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

   # 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

patch.diff Magnifier (910 Bytes) Vincent Robert, 2017-07-04 10:29

Associated revisions

Revision 17174
Added by Go MAEDA 8 days ago

Log exception's message when ActionView::MissingTemplate is raised (#26341).

Patch by Vincent Robert.


#1 Updated by Pavel Rosick√Ĺ 7 months ago


#2 Updated by Marius BALTEANU 7 months ago

+ 1. Very useful.

#3 Updated by Go MAEDA 7 months ago

  • Target version set to Candidate for next minor release

I also suffered from this error when r16401 was committed.

#4 Updated by Go MAEDA 6 months ago

  • Target version changed from Candidate for next minor release to 4.1.0

#5 Updated by Go MAEDA 6 months ago

  • Category set to Administration

#6 Updated by Angelinsky7 Angelinsky7 6 months ago


#7 Updated by Toshi MARUYAMA 5 months ago

  • Subject changed from Add useful details to error message to Add useful details to error message when a template is missing

#8 Updated by Go MAEDA 8 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed. Thank you for submitting the patch.

Also available in: Atom PDF