resume logging errors
authorTom Clegg <tom@clinicalfuture.com>
Fri, 11 Jan 2013 07:41:42 +0000 (23:41 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Fri, 11 Jan 2013 07:45:11 +0000 (23:45 -0800)
app/controllers/application_controller.rb

index 7590d13f1360fd10a85a3a2b7efeab118742d1ad..2bbcee8c2d0f0c1eb4f44cb82f2860441a7d154a 100644 (file)
@@ -17,6 +17,8 @@ class ApplicationController < ActionController::Base
   end
 
   def render_error(e)
+    logger.error e.inspect
+    logger.error e.backtrace.collect { |x| x + "\n" } if e.backtrace
     if @object and @object.errors and @object.errors.full_messages
       errors = @object.errors.full_messages
     else
@@ -25,7 +27,8 @@ class ApplicationController < ActionController::Base
     render json: { errors: errors }, status: 422
   end
 
-  def render_not_found
+  def render_not_found(e=ActionController::RoutingError.new("Path not found"))
+    logger.error e.inspect
     render json: { errors: ["Path not found"] }, status: 401
   end