Module Cms::ContentRenderingSupport
In: lib/cms/content_rendering_support.rb

Methods

Public Class methods

[Source]

    # File lib/cms/content_rendering_support.rb, line 7
 7:     def self.included(base)
 8:       base.send :include, Cms::ErrorHandling
 9: 
10:       base.rescue_from Exception, :with => :handle_server_error_on_page
11:       base.rescue_from Cms::Errors::AccessDenied, :with => :handle_access_denied_on_page
12:       base.rescue_from ActiveRecord::RecordNotFound, :with => :handle_not_found_on_page
13:     end

Public Instance methods

[Source]

    # File lib/cms/content_rendering_support.rb, line 20
20:     def handle_access_denied_on_page(exception)
21:       logger.warn "Access Denied"
22:       handle_error_with_cms_page('/system/access_denied', exception, :forbidden)
23:     end

[Source]

    # File lib/cms/content_rendering_support.rb, line 15
15:     def handle_not_found_on_page(exception)
16:       logger.warn "Page Not Found"
17:       handle_error_with_cms_page('/system/not_found', exception, :not_found)
18:     end

[Source]

    # File lib/cms/content_rendering_support.rb, line 25
25:     def handle_server_error_on_page(exception)
26:       logger.warn "Exception: #{exception.message}\n"
27:       logger.warn "#{exception.backtrace.join("\n")}\n"
28:       handle_error_with_cms_page('/system/server_error', exception, :internal_server_error)
29:     end

[Validate]