[Rails] exception handling not working?

2011-10-25 Thread Rajinder Yadav
I am playing with Rails 3.1.1 and made a simple blog app. I created a unique index on a field and when I submit a new post, it throws an exception if the field is not unique. I've added a rescue, but it's not doing anything? What am I doing wrong. def create @post = Post.new(params[:pos

Re: [Rails] exception handling

2010-04-26 Thread Dhruva Sagar
Well you can specify a default page / controller action to perform for unmatched routes as well...so if the route doesn't exist it shows a much user friendly page instead of the rails error message Thanks & Regards, Dhruva Sagar. On Mon, Apr 26, 2010 at 13:52, Tom Mac wrote: > Hi > I have co

[Rails] exception handling

2010-04-26 Thread Tom Mac
Hi I have controller edit action like def edit begin @user = User.find(params[:id]) rescue ActiveRecord::RecordNotFound logger.warn "User with id #{current_user.id} tried to edit user with id #{params[:id]}" render :file => "#{RAILS_ROOT}/public/404.html" else --- en

[Rails] How to use Rails' exception handling mechanism in a background thread?

2008-10-08 Thread Myron Marston
green threads since I'm using JRuby. I'm unsure how to handle exceptions in the background thread. I'd like to pass it to Rails' exception handling mechanism so that it is dealt with in the same way as exceptions that occur during the normal request-response cycle (except for r

[Rails] Exception handling is driving me nuts.

2008-10-07 Thread Tim Uckun
I am utterly unable to control how exceptions are handled in my application and it's driving me nuts The idea is simple. I have a SOAP handler like this. class RtiController < ApplicationController begin wsdl_service_name 'Rti' web_service_scaffold :invoke web_service_api RtiA