Class: TwirpRails::ErrorHandling::Base::ErrorHandler
- Inherits:
-
Struct
- Object
- Struct
- TwirpRails::ErrorHandling::Base::ErrorHandler
- Defined in:
- lib/twirp_rails/error_handling/base.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
20 21 22 |
# File 'lib/twirp_rails/error_handling/base.rb', line 20 def code @code end |
#proc ⇒ Object
Returns the value of attribute proc
20 21 22 |
# File 'lib/twirp_rails/error_handling/base.rb', line 20 def proc @proc end |
Instance Method Details
#handle(error, client) ⇒ Object
25 26 27 |
# File 'lib/twirp_rails/error_handling/base.rb', line 25 def handle(error, client) proc.call(error, client) end |
#match?(error) ⇒ Boolean
21 22 23 |
# File 'lib/twirp_rails/error_handling/base.rb', line 21 def match?(error) error.code == self.code end |
#process(error, client) ⇒ Object
29 30 31 |
# File 'lib/twirp_rails/error_handling/base.rb', line 29 def process(error, client) match?(error) ? handle(error, client) : nil end |