Exception: Aspera::RestCallError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/aspera/rest_call_error.rb

Overview

raised on error after REST call

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ RestCallError



19
20
21
22
23
# File 'lib/aspera/rest_call_error.rb', line 19

def initialize(context)
  context = {messages: [context]} if context.is_a?(String)
  @context = context
  super(@context[:messages].join("\n"))
end

Instance Method Details

#dataObject



14
15
16
# File 'lib/aspera/rest_call_error.rb', line 14

def data
  @context[:data]
end

#requestObject



6
7
8
# File 'lib/aspera/rest_call_error.rb', line 6

def request
  @context[:request]
end

#responseObject



10
11
12
# File 'lib/aspera/rest_call_error.rb', line 10

def response
  @context[:response]
end