Sha256: f5edbd454551fc6ae8a666a18cf6c53c24a31a26a6571844b9935e8ecf4e6af6

Contents?: true

Size: 658 Bytes

Versions: 42

Compression:

Stored size: 658 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 performing task #{ task }. #{ operation }"\
          "(#{ JSON.generate(parameters) }): #{ exception.message }"
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
builderator-2.1.1 lib/builderator/util/aws_exception.rb
builderator-2.1.0 lib/builderator/util/aws_exception.rb
builderator-2.0.4 lib/builderator/util/aws_exception.rb
builderator-2.0.3 lib/builderator/util/aws_exception.rb
builderator-2.0.2 lib/builderator/util/aws_exception.rb
builderator-2.0.1 lib/builderator/util/aws_exception.rb
builderator-2.0.0 lib/builderator/util/aws_exception.rb
builderator-1.3.2 lib/builderator/util/aws_exception.rb
builderator-1.3.1 lib/builderator/util/aws_exception.rb
builderator-1.3.0 lib/builderator/util/aws_exception.rb
builderator-1.2.3.pre.beta.1 lib/builderator/util/aws_exception.rb
builderator-1.2.2 lib/builderator/util/aws_exception.rb
builderator-1.2.1 lib/builderator/util/aws_exception.rb
builderator-1.2.0 lib/builderator/util/aws_exception.rb
builderator-1.1.12 lib/builderator/util/aws_exception.rb
builderator-1.1.11 lib/builderator/util/aws_exception.rb
builderator-1.1.10 lib/builderator/util/aws_exception.rb
builderator-1.1.9 lib/builderator/util/aws_exception.rb
builderator-1.1.8 lib/builderator/util/aws_exception.rb
builderator-1.1.7 lib/builderator/util/aws_exception.rb