how to raise exception with save!

Hi,

I am using transaction as :

Merchant.transaction do   @merchant.save! end

Now, how can I trap the exception and show in a user friendly way if the save fails. I need to show signup again if save fails, and go to 'profile' if save is a success. How can I do that ?

rescue that exception...

something like:

begin    Merchant.transaction do      @merchant.save!    end rescue WhateverTheExceptionThrownNameIsHere    redirect_to '/doh_an_error'    # or set flash[:error] or a add an error or something else end