Sha256: eda4b11ea3af3c43767420cc4b33561dfe4b9119e96225e3f85cfaa456a78726

Contents?: true

Size: 968 Bytes

Versions: 1

Compression:

Stored size: 968 Bytes

Contents

module PuppetForge
  class Error < RuntimeError
    attr_accessor :original
    def initialize(message, original=nil)
      super(message)
      @original = original
    end
  end

  class ExecutionFailure < PuppetForge::Error
  end

  class InvalidPathInPackageError < PuppetForge::Error
    def initialize(options)
      @entry_path = options[:entry_path]
      @directory  = options[:directory]
      super "Attempt to install file into #{@entry_path.inspect} under #{@directory.inspect}"
    end

    def multiline
      <<-MSG.strip
Could not install package
  Package attempted to install file into
  #{@entry_path.inspect} under #{@directory.inspect}.
      MSG
    end
  end

  class ModuleNotFound < PuppetForge::Error
  end

  class ModuleReleaseNotFound < PuppetForge::Error
  end

  class ModuleReleaseForbidden < PuppetForge::Error
    def self.from_response(response)
      body = JSON.parse(response[:body])
      new(body["message"])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
r10k-2.0.3 lib/shared/puppet_forge/error.rb