Class: Rack::MailException
- Inherits:
-
Object
- Object
- Rack::MailException
- Defined in:
- lib/rack/mail_exception.rb
Constant Summary collapse
- VERSION =
"0.0.1"
- FILTERING =
%(['"]?%s['"]?=>?([^&\s]*))
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ MailException
constructor
A new instance of MailException.
Constructor Details
#initialize(app, options = {}) ⇒ MailException
Returns a new instance of MailException.
20 21 22 23 24 25 26 27 |
# File 'lib/rack/mail_exception.rb', line 20 def initialize(app, = {}) @to = [:to] || raise(ArgumentError, ":to is required") @from = [:from] || raise(ArgumentError, ":from is required") @subject = [:subject] || "[Application Exception] %s" @filters = Array([:filters]) @app = app end |
Instance Method Details
#call(env) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rack/mail_exception.rb', line 29 def call(env) status, headers, body = begin @app.call(env) rescue Exception => ex notify ex, env raise ex end [status, headers, body] end |