Exception: Svelte::HTTPError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/svelte/errors/http_error.rb

Overview

Svelte error class to represent networking errors It can be customized by passing a specific errror message and a parent exception, which will contain the http driver specific error that generated it

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, parent: nil) ⇒ HTTPError

Creates a new HTTPError with a message and a parent error

Parameters:

  • message (String) (defaults to: nil)

    exception message

  • parent (defaults to: nil)

    the parent exception



14
15
16
17
# File 'lib/svelte/errors/http_error.rb', line 14

def initialize(message: nil, parent: nil)
  @parent = parent
  super(message || (parent&.message))
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.



9
10
11
# File 'lib/svelte/errors/http_error.rb', line 9

def parent
  @parent
end