Sha256: 22dbf2e3df5a72a87bdcf8d8960cb9696e81c4c2c268cca8412bad51bc95bed8

Contents?: true

Size: 613 Bytes

Versions: 1

Compression:

Stored size: 613 Bytes

Contents

require 'timeout'

module Evrone
  module Common
    module Spawn

      class TimeoutError < ::Timeout::Error

        def initialize(cmd, seconds)
          @cmd = cmd
          @seconds = seconds
        end

        def to_s
          "Execution expired, command did not finish within #{@seconds} seconds"
        end

      end

      class ReadTimeoutError < ::Timeout::Error

        def initialize(cmd, seconds)
          @cmd = cmd
          @seconds = seconds
        end

        def to_s
          "No output has been received in the last #{@seconds} seconds"
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
evrone-common-spawn-0.0.7 lib/evrone/common/spawn/error.rb