Sha256: 95f75c4c4ebdb94e7592fa9f9f60a9d1903ae182850997aab952521248baffe9

Contents?: true

Size: 512 Bytes

Versions: 2

Compression:

Stored size: 512 Bytes

Contents

module Rhea
  class BaseController < ActionController::Base
    protect_from_forgery

    layout 'rhea/layouts/application'

    helper Rhea::Helper

    around_filter :rescue_exceptions

    private

    def rescue_exceptions
      yield
    rescue Errno::ECONNREFUSED
      render_connection_exception
    rescue Rhea::Kubernetes::ServerError => e
      flash[:alert] = e.message
      render_connection_exception
    end

    def render_connection_exception
      render 'rhea/errors/index'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rhea-0.2.0 app/controllers/rhea/base_controller.rb
rhea-0.1.0 app/controllers/rhea/base_controller.rb