Class: Rack::ErrorToSlack
- Inherits:
-
Object
- Object
- Rack::ErrorToSlack
- Defined in:
- lib/rack/error_to_slack.rb,
lib/rack/error_to_slack/message.rb,
lib/rack/error_to_slack/version.rb,
lib/rack/error_to_slack/configuration.rb
Overview
ErrorToSlack Class
Defined Under Namespace
Classes: Configuration, Message
Constant Summary collapse
- VERSION =
'0.1.0'
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ErrorToSlack
constructor
A new instance of ErrorToSlack.
Constructor Details
#initialize(app) ⇒ ErrorToSlack
Returns a new instance of ErrorToSlack.
8 9 10 |
# File 'lib/rack/error_to_slack.rb', line 8 def initialize(app) @app = app end |
Class Method Details
.configuration ⇒ Object
27 28 29 |
# File 'lib/rack/error_to_slack.rb', line 27 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
23 24 25 |
# File 'lib/rack/error_to_slack.rb', line 23 def configure yield(configuration) end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/rack/error_to_slack.rb', line 12 def call(env) begin response = @app.call(env) rescue Exception => exception Message.new(env, exception.).send raise exception end response end |