maeshimaの日記

メモ書きです

rescue_from

エラーのクラスを見て処理を振り分けるメソッド。rescue_actionでcase whenしてるのであんまつかわんけど一応メモ

 rescue_from ActiveRecord::RecordInvalid, :with => :show_errors
 rescue_from 'MyAppError::Base' do |exception|
   render :xml => exception, :status => 500
 end