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.
256 257 258 259 |
# File 'lib/safire/errors.rb', line 256 def initialize(error_description: nil) @error_description = error_description super() end |
Instance Attribute Details
#error_description ⇒ String? (readonly)
Returns the underlying transport error message.
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/safire/errors.rb', line 253 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 |