Sha256: 2ec4a2c94dfa34626f659c1313ee25e07b676d21c2e59d9e9f143acd3bb2541f

Contents?: true

Size: 914 Bytes

Versions: 17

Compression:

Stored size: 914 Bytes

Contents

# frozen_string_literal: true

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

      def initialize(message, issue_code)
        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 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

17 entries across 17 versions & 1 rubygems

Version Path
bolt-0.21.5 lib/bolt/node/errors.rb
bolt-0.21.4 lib/bolt/node/errors.rb
bolt-0.21.3 lib/bolt/node/errors.rb
bolt-0.21.2 lib/bolt/node/errors.rb
bolt-0.21.1 lib/bolt/node/errors.rb
bolt-0.21.0 lib/bolt/node/errors.rb
bolt-0.20.7 lib/bolt/node/errors.rb
bolt-0.20.6 lib/bolt/node/errors.rb
bolt-0.20.5 lib/bolt/node/errors.rb
bolt-0.20.3 lib/bolt/node/errors.rb
bolt-0.20.2 lib/bolt/node/errors.rb
bolt-0.20.0 lib/bolt/node/errors.rb
bolt-0.19.1 lib/bolt/node/errors.rb
bolt-0.19.0 lib/bolt/node/errors.rb
bolt-0.18.2 lib/bolt/node/errors.rb
bolt-0.18.1 lib/bolt/node/errors.rb
bolt-0.18.0 lib/bolt/node/errors.rb