Exception: Pictify::NetworkError

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

Overview

Raised when a network error occurs.

Instance Attribute Summary collapse

Attributes inherited from Error

#response_body, #status_code

Instance Method Summary collapse

Methods inherited from Error

#message, #to_s

Constructor Details

#initialize(message = nil, original_error: nil) ⇒ NetworkError

Returns a new instance of NetworkError.



112
113
114
115
# File 'lib/pictify/errors.rb', line 112

def initialize(message = nil, original_error: nil)
  @original_error = original_error
  super(message || original_error&.message || "Network error occurred")
end

Instance Attribute Details

#original_errorObject (readonly)

Returns the value of attribute original_error.



110
111
112
# File 'lib/pictify/errors.rb', line 110

def original_error
  @original_error
end