Class: Apia::DSLs::Error

Inherits:
Apia::DSL show all
Includes:
Concerns::HasFields
Defined in:
lib/apia/dsls/error.rb

Instance Method Summary collapse

Methods included from Concerns::HasFields

#field

Methods inherited from Apia::DSL

#description, #initialize, #name, #no_schema

Constructor Details

This class inherits a constructor from Apia::DSL

Instance Method Details

#catch_exception(klass, &block) ⇒ Object



20
21
22
# File 'lib/apia/dsls/error.rb', line 20

def catch_exception(klass, &block)
  @definition.catchable_exceptions[klass] = block
end

#code(code) ⇒ Object



12
13
14
# File 'lib/apia/dsls/error.rb', line 12

def code(code)
  @definition.code = code
end

#http_status(http_status) ⇒ Object



16
17
18
# File 'lib/apia/dsls/error.rb', line 16

def http_status(http_status)
  @definition.http_status = http_status
end