how to raise exception with save!


I am using transaction as :

Merchant.transaction do! 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!    end rescue WhateverTheExceptionThrownNameIsHere    redirect_to '/doh_an_error'    # or set flash[:error] or a add an error or something else end