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.59.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.58.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.57.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.56.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.55.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.54.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.53.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.52.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.51.3 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.51.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.51.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.51.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.50.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.49.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.48.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.47.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.46.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.45.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.44.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.43.1 lib/cc/analyzer/raising_container_listener.rb