mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
ActiveRecord::RecordNotFound exceptions handled more gracefully
git-svn-id: http://redmine.rubyforge.org/svn/trunk@133 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -39,8 +39,7 @@ class VersionsController < ApplicationController
|
||||
@attachment.increment_download
|
||||
send_file @attachment.diskfile, :filename => @attachment.filename
|
||||
rescue
|
||||
flash.now[:notice] = l(:notice_file_not_found)
|
||||
render :text => "", :layout => true, :status => 404
|
||||
render_404
|
||||
end
|
||||
|
||||
def destroy_file
|
||||
@@ -53,5 +52,7 @@ private
|
||||
def find_project
|
||||
@version = Version.find(params[:id])
|
||||
@project = @version.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user