Skip to content

Commit

Permalink
Added more informative error message for "file not found" situation i…
Browse files Browse the repository at this point in the history
…n send_file rails#484 [Alexey]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@427 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jan 16, 2005
1 parent bc4156e commit 9a33b9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/base.rb
Expand Up @@ -441,7 +441,7 @@ def render_nothing(status = nil)
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
# for the Cache-Control header spec.
def send_file(path, options = {}) #:doc:
raise MissingFile, path unless File.file?(path) and File.readable?(path)
raise MissingFile, "Cannot read file #{path}" unless File.file?(path) and File.readable?(path)

options[:length] ||= File.size(path)
options[:filename] ||= File.basename(path)
Expand Down

0 comments on commit 9a33b9a

Please sign in to comment.