Sha256: 9b559407bcc2b060a32bae82c5ac7216307d58d67aedb3f8e9b5d58e23a3c501

Contents?: true

Size: 843 Bytes

Versions: 10

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true

# 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", format: :html, status: 500, locals: { exception: exception }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fat_free_crm-0.20.1 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.20.0 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.19.2 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.19.0 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.18.2 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.17.3 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.18.1 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.18.0 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.17.2 lib/fat_free_crm/exceptions.rb
fat_free_crm-0.17.1 lib/fat_free_crm/exceptions.rb