Module: Excepty::ExceptionInterceptor

Defined in:
lib/excepty/exception_interceptor.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
# File 'lib/excepty/exception_interceptor.rb', line 4

def self.included(base)
  base.send( :alias_method_chain, :render_exception, :excepty )
  Excepty::Manager.logga "Excepty - ExceptionInterceptor - included" if EXCEPTY_IN_TESTING_MODE
end

Instance Method Details

#render_exception_with_excepty(env, exception) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/excepty/exception_interceptor.rb', line 9

def render_exception_with_excepty( env, exception )
  Excepty::Manager.logga "Excepty - ExceptionInterceptor - render_exception_with_excepty" if EXCEPTY_IN_TESTING_MODE
  begin
    Excepty::Manager.analyse_exception( env, exception )
  rescue Exception => e
    Excepty::Manager.logga "EXCEPTION" if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga e if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga "e.class" if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga e.class if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga "e.message" if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga e.message if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga "e.backtrace" if EXCEPTY_IN_TESTING_MODE
    Excepty::Manager.logga e.backtrace if EXCEPTY_IN_TESTING_MODE
  end
  
  render_exception_without_excepty( env, exception )
end