Exception: DLException

Inherits:
Exception
  • Object
show all
Defined in:
lib/datalanche/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, body, debug_info) ⇒ DLException

Returns a new instance of DLException.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/datalanche/exception.rb', line 7

def initialize(status_code, body, debug_info)

    @request = debug_info['request']
    @response = debug_info['response']
    @response['body'] = body
    @error_message = debug_info['response']['message']
    @error_type = body
    @status_code = status_code

    @detail = {
        'status_code' => @status_code,
        'error_message' => @error_message,
        'error_type' => @error_type,
        'request' => @request,
        'response' => @response
    }
end

Instance Attribute Details

#detailObject

Returns the value of attribute detail.



5
6
7
# File 'lib/datalanche/exception.rb', line 5

def detail
  @detail
end

#status_codeObject

Returns the value of attribute status_code.



5
6
7
# File 'lib/datalanche/exception.rb', line 5

def status_code
  @status_code
end