Skip to content

Instantly share code, notes, and snippets.

@phuesler
Created January 27, 2010 15:09
Show Gist options
  • Save phuesler/287910 to your computer and use it in GitHub Desktop.
Save phuesler/287910 to your computer and use it in GitHub Desktop.
# actionpack-2.3.4/test/controller/rescue_test.rb
# Removed code for simplicity
class RescueController < ActionController::Base
# Omitted the exception declarations such as NotAuthorized
def method_not_allowed
raise ActionController::MethodNotAllowed.new(:get, :head, :put)
end
def not_implemented
raise ActionController::NotImplemented.new(:get, :put)
end
def not_authorized
raise NotAuthorized
end
def bad_gateway
raise BadGateway
end
def resource_unavailable
raise ResourceUnavailable
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment