Sha256: 7c48be6553390a4ddc2bfd41f54819b2e1331dd461f88487542bc5cf3b43d131

Contents?: true

Size: 1.08 KB

Versions: 121

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require 'bolt/error'

module Bolt
  class Node
    class BaseError < Bolt::Error
      attr_reader :issue_code

      # TODO: can we just drop issue code here?
      def initialize(message, issue_code = nil)
        super(message, kind, nil, issue_code)
      end

      def kind
        'puppetlabs.tasks/node-error'
      end
    end

    class ConnectError < BaseError
      def kind
        'puppetlabs.tasks/connect-error'
      end
    end

    class EscalateError < BaseError
      def kind
        'puppetlabs.tasks/escalate-error'
      end
    end

    class FileError < BaseError
      def kind
        'puppetlabs.tasks/task_file_error'
      end
    end

    class RemoteError < BaseError
      def kind
        'puppetlabs.tasks/remote-task-error'
      end
    end

    class EnvironmentVarError < BaseError
      def initialize(var, val)
        message = "Could not set environment variable '#{var}' to '#{val}'"
        super(message, 'ENVVAR_ERROR')
      end

      def kind
        'puppetlabs.tasks/environment-var-error'
      end
    end
  end
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
bolt-3.17.0 lib/bolt/node/errors.rb
bolt-3.16.1 lib/bolt/node/errors.rb
bolt-3.16.0 lib/bolt/node/errors.rb
bolt-3.15.0 lib/bolt/node/errors.rb
bolt-3.14.1 lib/bolt/node/errors.rb
bolt-3.13.0 lib/bolt/node/errors.rb
bolt-3.12.0 lib/bolt/node/errors.rb
bolt-3.11.0 lib/bolt/node/errors.rb
bolt-3.10.0 lib/bolt/node/errors.rb
bolt-3.9.2 lib/bolt/node/errors.rb
bolt-3.9.1 lib/bolt/node/errors.rb
bolt-3.9.0 lib/bolt/node/errors.rb
bolt-3.8.1 lib/bolt/node/errors.rb
bolt-3.8.0 lib/bolt/node/errors.rb
bolt-3.7.1 lib/bolt/node/errors.rb
bolt-3.7.0 lib/bolt/node/errors.rb
bolt-3.6.1 lib/bolt/node/errors.rb
bolt-3.6.0 lib/bolt/node/errors.rb
bolt-3.5.0 lib/bolt/node/errors.rb
bolt-3.4.0 lib/bolt/node/errors.rb