Class: XRayCause

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_lambda_ric/xray_cause.rb

Constant Summary collapse

MAX_DEPTH =
15

Instance Method Summary collapse

Constructor Details

#initialize(lambda_error) ⇒ XRayCause

Returns a new instance of XRayCause.



8
9
10
11
12
13
14
# File 'lib/aws_lambda_ric/xray_cause.rb', line 8

def initialize(lambda_error)
  @cause = {
    working_directory: Dir.pwd,
    paths: Gem.paths.path,
    exceptions: lambda_error ? normalize(err: lambda_error) : lambda_error
  }
end

Instance Method Details

#as_jsonObject



16
17
18
19
20
# File 'lib/aws_lambda_ric/xray_cause.rb', line 16

def as_json
  @as_json ||= begin
    JSON.dump(@cause)
  end
end