Sha256: b837b8c2101311903d16d86b07ffaa4f76f9f4715f79a837cb845b8e6199f646

Contents?: true

Size: 1.45 KB

Versions: 10

Compression:

Stored size: 1.45 KB

Contents

#Copyright (c) 2008-2009 Peter H. Boling of 9thBit LLC
#Released under the MIT license

module SuperExceptionNotifier
  module CustomExceptionMethods

    protected
    
    #For a while after disabling a route/URL that had been functional we should set it to resource gone to inform people to remove bookmarks.
    def resource_gone
      raise ResourceGone
    end
    #Then for things that have never existed or have not for a long time we call not_implemented
    def not_implemented
      raise NotImplemented
    end
    #Resources that must be requested with a specific HTTP Method (GET, PUT, POST, DELETE, AJAX, etc) but are requested otherwise should:
    def invalid_method
      raise InvalidMethod
    end
    #If your ever at a spot in the code that should never get reached, but corrupt data might get you there anyways then this is for you:
    def corrupt_data
      raise CorruptData
    end
    def page_not_found
      raise PageNotFound
    end
    def record_not_found
      raise ActiveRecord::RecordNotFound
    end
    def method_disabled
      raise MethodDisabled
    end
    #The current user does not have enough privileges to access the requested resource
    def access_denied
      raise AccessDenied
    end

    def generic_error
      error_stickie("Sorry, an error has occurred.")
      corrupt_data
    end

    def invalid_page
      error_stickie("Sorry, the page number you requested was not valid.")
      page_not_found
    end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
super_exception_notifier-2.0.8 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.7 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.6 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.5 lib/super_exception_notifier/custom_exception_methods.rb
bmpercy-exception_notification-2.0.5 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.4 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.3 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.2 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.1 lib/super_exception_notifier/custom_exception_methods.rb
super_exception_notifier-2.0.0 lib/super_exception_notifier/custom_exception_methods.rb