Sha256: 0eb8de58f305042c4f13b5555683bc0b472dae4b0c8ef62a9d2698ca218904ff

Contents?: true

Size: 813 Bytes

Versions: 66

Compression:

Stored size: 813 Bytes

Contents

module CC
  module Analyzer
    class RaisingContainerListener < ContainerListener
      def initialize(engine_name, failure_ex, timeout_ex)
        @engine_name = engine_name
        @failure_ex = failure_ex
        @timeout_ex = timeout_ex
      end

      def timed_out(data)
        message = "engine #{engine_name} ran for #{data.duration} seconds"
        message << " and was killed"

        raise timeout_ex, message
      end

      def finished(data)
        unless data.status.success?
          message = "engine #{engine_name} failed"
          message << " with status #{data.status.exitstatus}"
          message << " and stderr \n#{data.stderr}"

          raise failure_ex, message
        end
      end

      private

      attr_reader :engine_name, :failure_ex, :timeout_ex
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
codeclimate-0.21.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.21.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.21.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.20.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.20.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.20.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.19.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.19.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.19.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.6 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.5 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.4 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.3 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.18.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.17.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.16.6 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.16.5 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.16.4 lib/cc/analyzer/raising_container_listener.rb