Exception: Builderator::Util::AwsException

Inherits:
TaskException
  • Object
show all
Defined in:
lib/builderator/util/aws_exception.rb

Overview

Exception raised if a safety limit is exceeded

Instance Attribute Summary collapse

Attributes inherited from TaskException

#task

Instance Method Summary collapse

Methods inherited from TaskException

#status

Constructor Details

#initialize(task, exception) ⇒ AwsException

Returns a new instance of AwsException.



12
13
14
15
# File 'lib/builderator/util/aws_exception.rb', line 12

def initialize(task, exception)
  super(:fail, task, :red)
  @exception = exception
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



10
11
12
# File 'lib/builderator/util/aws_exception.rb', line 10

def exception
  @exception
end

Instance Method Details

#messageObject



25
26
27
28
# File 'lib/builderator/util/aws_exception.rb', line 25

def message
  "An error occured performing task #{ task }. #{ operation }"\
    "(#{ JSON.generate(parameters) }): #{ exception.message }"
end

#operationObject



17
18
19
# File 'lib/builderator/util/aws_exception.rb', line 17

def operation
  @exception.context.operation_name
end

#parametersObject



21
22
23
# File 'lib/builderator/util/aws_exception.rb', line 21

def parameters
  @exception.context.params
end