Module: SuperExceptionNotifier::CustomExceptionMethods

Defined in:
lib/super_exception_notifier/custom_exception_methods.rb

Instance Method Summary collapse

Instance Method Details

#access_deniedObject

The current user does not have enough privileges to access the requested resource

Raises:

  • (AccessDenied)


33
34
35
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 33

def access_denied
  raise AccessDenied
end

#corrupt_dataObject

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:

Raises:

  • (CorruptData)


20
21
22
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 20

def corrupt_data
  raise CorruptData
end

#invalid_methodObject

Resources that must be requested with a specific HTTP Meethod (GET, PUT, POST, DELETE, AJAX, etc) but are requested otherwise should:

Raises:

  • (InvalidMethod)


16
17
18
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 16

def invalid_method
  raise InvalidMethod
end

#method_disabledObject

Raises:

  • (MethodDisabled)


29
30
31
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 29

def method_disabled
  raise MethodDisabled
end

#not_implementedObject

Then for things that have never existed or have not for a long time we call not_implemented

Raises:

  • (NotImplemented)


12
13
14
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 12

def not_implemented
  raise NotImplemented
end

#page_not_foundObject

Raises:

  • (PageNotFound)


23
24
25
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 23

def page_not_found
  raise PageNotFound
end

#record_not_foundObject

Raises:

  • (ActiveRecord::RecordNotFound)


26
27
28
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 26

def record_not_found
  raise ActiveRecord::RecordNotFound
end

#resource_goneObject

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.

Raises:

  • (ResourceGone)


8
9
10
# File 'lib/super_exception_notifier/custom_exception_methods.rb', line 8

def resource_gone
  raise ResourceGone
end