diff --git a/app/controllers/sources_controller.rb b/app/controllers/sources_controller.rb index 6e272e3da..6b86f08fa 100644 --- a/app/controllers/sources_controller.rb +++ b/app/controllers/sources_controller.rb @@ -9,14 +9,4 @@ class SourcesController < ApplicationController format.xml { render xml: @source.to_h.to_xml(root: "source") } end end - -private - - def rescue_exception(exception) - respond_with do |format| - format.json do - render :json => {:message => exception.to_s, :backtrace => exception.backtrace}, :status => :error - end - end - end end diff --git a/app/views/static/error.json.erb b/app/views/static/error.json.erb index 2bc0e5059..e2fa831d9 100644 --- a/app/views/static/error.json.erb +++ b/app/views/static/error.json.erb @@ -1,5 +1,9 @@ <% if @error_message %> {"success": false, "message": <%= raw @error_message.encode("utf-8", {:invalid => :replace, :undef => :replace, :replace => "?"}).to_json %>} <% else %> -{"success": false, "message": <%= raw @exception.to_s.encode("utf-8", {:invalid => :replace, :undef => :replace, :replace => "?"}).to_json %>} + { + "success": false, + "message": <%= raw @exception.to_s.encode("utf-8", {:invalid => :replace, :undef => :replace, :replace => "?"}).to_json %>, + "backtrace": <%= raw @exception.backtrace.to_json %> + } <% end %>