Module: Kybus::Exceptions::HTTP
- Defined in:
- lib/kybus/http_exceptions.rb
Overview
Provides basic execptions for http common errors.
Constant Summary collapse
- EXCEPTION_TYPES =
{ success: Kybus::Exceptions::KybusSuccess, fail: Kybus::Exceptions::KybusFail, error: Kybus::Exceptions::KybusError }.freeze
Class Method Summary collapse
Class Method Details
.new_http_exception(class_name, http_code, type) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kybus/http_exceptions.rb', line 16 def new_http_exception(class_name, http_code, type) parent = exception_type(type) http_exception_class = Class.new(parent) do def initialize(, object = {}) super(, nil, object) end define_method 'http_code' do http_code end end const_set(class_name, http_exception_class) end |