Sha256: 00fd5acb074bf16b7ae2a41b002425765d4bd3bded08ab8a8b49a30761ec5ab2

Contents?: true

Size: 844 Bytes

Versions: 8

Compression:

Stored size: 844 Bytes

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module FatFreeCRM
  class MissingSettings < StandardError; end
  class ObsoleteSettings < StandardError; end
end

class ActionController::Base
  rescue_from FatFreeCRM::MissingSettings,  :with => :render_fat_free_crm_exception
  rescue_from FatFreeCRM::ObsoleteSettings, :with => :render_fat_free_crm_exception

  private

  def render_fat_free_crm_exception(exception)
    logger.error exception.inspect
    render :layout => false, :template => "/layouts/500.html.haml", :status => 500, :locals => { :exception => exception.to_s.html_safe }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fat_free_crm-0.13.3 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.13.2 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.12.3 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.12.2 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.13.1 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.12.1 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.13.0 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.12.0 lib/fat_free_crm/exceptions.rb