Sha256: 4e61a8c8a6a3283af1ffea8f6aa916f24b088623d96bd3ff40a26edd9dd0ca00

Contents?: true

Size: 668 Bytes

Versions: 6

Compression:

Stored size: 668 Bytes

Contents

require 'json'
require_relative './task_exception'

module Builderator
  module Util
    ##
    # Exception raised if a safety limit is exceeded
    ##
    class AwsException < TaskException
      attr_reader :exception

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

      def operation
        @exception.context.operation_name
      end

      def parameters
        @exception.context.params
      end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
builderator-0.3.15 lib/builderator/util/aws_exception.rb
builderator-0.3.14 lib/builderator/util/aws_exception.rb
builderator-0.3.13 lib/builderator/util/aws_exception.rb
builderator-0.3.12 lib/builderator/util/aws_exception.rb
builderator-0.3.11 lib/builderator/util/aws_exception.rb
builderator-0.3.10 lib/builderator/util/aws_exception.rb