Sha256: 0a933070abf877c23c912eb55645f3f752b6fe4a59e69f816dc1547a112b75b8

Contents?: true

Size: 404 Bytes

Versions: 36

Compression:

Stored size: 404 Bytes

Contents

require 'exceptions'
module ExceptionHelper
  extend ActiveSupport::Concern

  included do
    include Exceptions
    rescue_from Exceptions::OxenStandardError, with: :system_error
  end

  private

  def system_error err
    flash[:alert] = "Fejl (%s): %s" % [ err.class.to_s, err.message]
    redirect_to (request.referrer || root_path)
  end

end

ApplicationController.send :include, ExceptionHelper

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
abstracted-0.4.22 config/initializers/exception.rb
abstracted-0.4.21 config/initializers/exception.rb
abstracted-0.4.20 config/initializers/exception.rb
abstracted-0.4.19 config/initializers/exception.rb
abstracted-0.4.18 config/initializers/exception.rb
abstracted-0.4.17 config/initializers/exception.rb
abstracted-0.4.16 config/initializers/exception.rb
abstracted-0.4.15 config/initializers/exception.rb
abstracted-0.4.14 config/initializers/exception.rb
abstracted-0.4.13 config/initializers/exception.rb
abstracted-0.4.12 config/initializers/exception.rb
abstracted-0.4.10 config/initializers/exception.rb
abstracted-0.4.9 config/initializers/exception.rb
abstracted-0.4.8 config/initializers/exception.rb
abstracted-0.4.7 config/initializers/exception.rb
abstracted-0.4.6 config/initializers/exception.rb
abstracted-0.4.5 config/initializers/exception.rb
abstracted-0.4.4 config/initializers/exception.rb
abstracted-0.4.3 config/initializers/exception.rb
abstracted-0.4.2 config/initializers/exception.rb