Exception: Safire::Errors::NetworkError
- Defined in:
- lib/safire/errors.rb
Overview
Raised when an HTTP request fails at the network or transport level (connection refused, timeout, SSL handshake failure, etc.).
Instance Attribute Summary collapse
-
#error_description ⇒ String?
readonly
The underlying transport error message.
Instance Method Summary collapse
-
#initialize(error_description: nil) ⇒ NetworkError
constructor
A new instance of NetworkError.
Constructor Details
#initialize(error_description: nil) ⇒ NetworkError
Returns a new instance of NetworkError.
205 206 207 208 |
# File 'lib/safire/errors.rb', line 205 def initialize(error_description: nil) @error_description = error_description super() end |
Instance Attribute Details
#error_description ⇒ String? (readonly)
Returns the underlying transport error message.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/safire/errors.rb', line 202 class NetworkError < Error attr_reader :error_description def initialize(error_description: nil) @error_description = error_description super() end private def return 'HTTP request failed' unless @error_description "HTTP request failed: #{@error_description}" end end |