Module: ExceptionNotifiable

Includes:
SuperExceptionNotifier::NotifiableHelper
Defined in:
lib/exception_notifiable.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary

Constants included from SuperExceptionNotifier::HelpfulHashes

SuperExceptionNotifier::HelpfulHashes::HTTP_STATUS_CODES, SuperExceptionNotifier::HelpfulHashes::SILENT_EXCEPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SuperExceptionNotifier::HooksNotifier

build_web_hook_params, deliver_exception_to_web_hooks, post_hook

Methods included from SuperExceptionNotifier::GitBlame

#blame_output, #exception_in_project?, #lay_blame

Methods included from SuperExceptionNotifier::HelpfulHashes

#codes_for_error_classes

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/exception_notifiable.rb', line 6

def self.included(base)
  base.extend ClassMethods

  # Adds the following class attributes to the classes that include ExceptionNotifiable
  #  HTTP status codes and what their 'English' status message is
  base.cattr_accessor :http_status_codes
  base.http_status_codes = HTTP_STATUS_CODES
  # error_layout:
  #   can be defined at controller level to the name of the desired error layout,
  #   or set to true to render the controller's own default layout,
  #   or set to false to render errors with no layout
  base.cattr_accessor :error_layout
  base.error_layout = nil
  # Rails error classes to rescue and how to rescue them (which error code to use)
  base.cattr_accessor :error_class_status_codes
  base.error_class_status_codes = self.codes_for_error_classes
  # Verbosity of the gem
  base.cattr_accessor :exception_notifiable_verbose
  base.exception_notifiable_verbose = false
  # Do Not Ever send error notification emails for these Error Classes
  base.cattr_accessor :exception_notifiable_silent_exceptions
  base.exception_notifiable_silent_exceptions = SILENT_EXCEPTIONS
  # Notification Level
  base.cattr_accessor :exception_notifiable_notification_level
  base.exception_notifiable_notification_level = [:render, :email, :web_hooks]
end

Instance Method Details

#be_silent_for_exception?(exception) ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/exception_notifiable.rb', line 65

def be_silent_for_exception?(exception)
  self.class.be_silent_for_exception?(exception)
end