Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyCustomError < StandardError; end
- class PostsController < ApplicationController
- rescue_from(MyCustomError) do |error|
- logger.info error.message
- end
- assume(:post) { raise MyCustomError.new('Caught by #rescue_from') }
- def show
- respond_to do |format|
- format.html
- format.xml { render :xml => post }
- end
- end
- end
Add Comment
Please, Sign In to add comment