Exception: Vibe::Error::ServiceError
- Defined in:
- lib/vibe/error/service_error.rb
Direct Known Subclasses
BadRequest, Forbidden, InternalServerError, NotFound, ServiceUnavailable, Unauthorized, UnprocessableEntity
Instance Attribute Summary collapse
-
#http_headers ⇒ Object
Returns the value of attribute http_headers.
Attributes inherited from VibeError
#response_headers, #response_message
Instance Method Summary collapse
- #generate_message(env) ⇒ Object
-
#initialize(env) ⇒ ServiceError
constructor
A new instance of ServiceError.
Constructor Details
#initialize(env) ⇒ ServiceError
Returns a new instance of ServiceError.
7 8 9 10 |
# File 'lib/vibe/error/service_error.rb', line 7 def initialize(env) super((env)) @http_headers = env[:response_headers] end |
Instance Attribute Details
#http_headers ⇒ Object
Returns the value of attribute http_headers.
5 6 7 |
# File 'lib/vibe/error/service_error.rb', line 5 def http_headers @http_headers end |
Instance Method Details
#generate_message(env) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/vibe/error/service_error.rb', line 12 def (env) if ENV['DEBUG'] "#{env[:method].to_s.upcase} #{env[:url].to_s}: #{env[:status]} #{env[:body]}" else env[:body] end end |