Exception: Fizzy::NetworkError

Inherits:
Error
  • Object
show all
Defined in:
lib/fizzy/errors.rb

Overview

Raised when there’s a network error (connection, timeout, DNS).

Instance Attribute Summary

Attributes inherited from Error

#cause, #code, #hint, #http_status, #request_id, #retry_after, #retryable

Instance Method Summary collapse

Methods inherited from Error

#exit_code, exit_code_for, #retryable?

Constructor Details

#initialize(message = "Network error", cause: nil) ⇒ NetworkError

Returns a new instance of NetworkError.



179
180
181
182
183
184
185
186
187
# File 'lib/fizzy/errors.rb', line 179

def initialize(message = "Network error", cause: nil)
  super(
    code: ErrorCode::NETWORK,
    message: message,
    hint: cause&.message || "Check your network connection",
    retryable: true,
    cause: cause
  )
end