From 9b9bee6746dcaca6c8636433f0e7349a77153d1a Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Fri, 10 Feb 2012 15:10:55 +0000 Subject: Make /similar/request/NONESUCH a 404 not 500 error Fixes #421. --- app/controllers/request_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 313a57d7d..378c74c30 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -137,6 +137,8 @@ class RequestController < ApplicationController @per_page = 25 @page = (params[:page] || "1").to_i @info_request = InfoRequest.find_by_url_title(params[:url_title]) + raise ActiveRecord::RecordNotFound.new("Request not found") if @info_request.nil? + if !@info_request.user_can_view?(authenticated_user) render :template => 'request/hidden', :status => 410 # gone return @@ -146,7 +148,7 @@ class RequestController < ApplicationController if (@page > 1) @page_desc = " (page " + @page.to_s + ")" - else + else @page_desc = "" end end -- cgit v1.2.3 From fe67273b5f1d25f31f38dbfcaaa7786e1cc63ce5 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Fri, 10 Feb 2012 18:06:41 +0000 Subject: Trailing whitespace --- app/controllers/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 378c74c30..ef958ae9d 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -839,7 +839,7 @@ class RequestController < ApplicationController logger.error("Could not convert info request #{info_request.id} to PDF with command '#{convert_command} #{url} #{tempfile.path}'") end tempfile.close - else + else logger.warn("No HTML -> PDF converter found at #{convert_command}") end if !done -- cgit v1.2.3