Class: Aws::Xray::Error

Inherits:
Struct
  • Object
show all
Defined in:
lib/aws/xray/error.rb

Constant Summary collapse

MAX_BACKTRACE_SIZE =
250

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#causeObject

Returns the value of attribute cause

Returns:

  • (Object)

    the current value of cause



5
6
7
# File 'lib/aws/xray/error.rb', line 5

def cause
  @cause
end

#eObject

Returns the value of attribute e

Returns:

  • (Object)

    the current value of e



5
6
7
# File 'lib/aws/xray/error.rb', line 5

def e
  @e
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



5
6
7
# File 'lib/aws/xray/error.rb', line 5

def error
  @error
end

#faultObject

Returns the value of attribute fault

Returns:

  • (Object)

    the current value of fault



5
6
7
# File 'lib/aws/xray/error.rb', line 5

def fault
  @fault
end

#remoteObject

Returns the value of attribute remote

Returns:

  • (Object)

    the current value of remote



5
6
7
# File 'lib/aws/xray/error.rb', line 5

def remote
  @remote
end

#throttleObject

Returns the value of attribute throttle

Returns:

  • (Object)

    the current value of throttle



5
6
7
# File 'lib/aws/xray/error.rb', line 5

def throttle
  @throttle
end

Instance Method Details

#to_hObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/aws/xray/error.rb', line 8

def to_h
  h = {
    error: error,
    throttle: throttle,
    fault: fault
  }
  if cause
    h[:cause] = cause.to_h(remote: remote)
  end
  # Overwrite cause because recording exception is more important.
  if e
    h[:cause] = build_cause_from_exception(e, remote)
  end
  h
end