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.69.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.68.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.67.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.66.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.65.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.64.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.7 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.6 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.5 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.4 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.3 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.63.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.62.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.61.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.61.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.60.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.60.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.59.1 lib/cc/analyzer/raising_container_listener.rb