Sha256: a2b27f26314ca9281dbcbfacd7489e5e547b174544fbd79d3d82a1de38c97d25

Contents?: true

Size: 820 Bytes

Versions: 86

Compression:

Stored size: 820 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 / 1000} 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

86 entries across 86 versions & 1 rubygems

Version Path
codeclimate-0.43.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.42.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.42.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.41.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.40.3 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.40.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.40.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.40.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.39.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.38.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.38.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.37.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.36.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.35.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.35.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.35.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.34.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.34.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.33.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.32.1 lib/cc/analyzer/raising_container_listener.rb