hi,i don't know how to capture the following exception if the file
directory or name is not correct.
##########
 def index
   @csv_array=[]
   begin
     CSV.foreach('files/sample.csv') do|row|
       sub_array=row
      @csv_array<<sub_array
     end
   rescue Exception=>e
     flash.now[:error]="error:#{e}"
     raise
   end
  end
#########
after execute the above method,i get the exception like the
following,but i don't like it.i don't know how to capture the exception
and display a nice message within app's layout.can you help me? thanks.

########
Errno::ENOENT in HomeController#index
No such file or directory - files/sample.csv
#########

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to