Module: Landline::DSL::CommonMethods
- Included in:
- App, ProcessorContext, TemplateContext
- Defined in:
- lib/landline/dsl/methods_common.rb
Overview
Methods shared by probes, preprocessors and filters.
Instance Method Summary collapse
-
#bounce ⇒ Object
(in Landline::Probe context) Bounce request to the next handler.
-
#die(errorcode, backtrace: nil, error: nil) ⇒ Object
(in Landline::Probe context) Stop execution and generate a boilerplate response with the given code.
Instance Method Details
#bounce ⇒ Object
(in Landline::Probe context) Bounce request to the next handler
28 29 30 |
# File 'lib/landline/dsl/methods_common.rb', line 28 def bounce throw :break end |
#die(errorcode, backtrace: nil, error: nil) ⇒ Object
(in Landline::Probe context) Stop execution and generate a boilerplate response with the given code
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/landline/dsl/methods_common.rb', line 12 def die(errorcode, backtrace: nil, error: nil) response = Landline::Response.convert( (@origin.properties["handle.#{errorcode}"] or @origin.properties["handle.default"]).call( errorcode, backtrace: backtrace, error: error ) ) response.status = errorcode if response.status == 200 throw :finish, response end |