Sha256: 34699463d1103aa761fe564736ff34b59918343274baa6c84f1e07624cbf41e1

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require_relative '../../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

17 entries across 17 versions & 1 rubygems

Version Path
bolt-3.29.0 lib/bolt/node/errors.rb
bolt-3.28.0 lib/bolt/node/errors.rb
bolt-3.27.4 lib/bolt/node/errors.rb
bolt-3.27.2 lib/bolt/node/errors.rb
bolt-3.27.1 lib/bolt/node/errors.rb
bolt-3.26.2 lib/bolt/node/errors.rb
bolt-3.26.1 lib/bolt/node/errors.rb
bolt-3.25.0 lib/bolt/node/errors.rb
bolt-3.24.0 lib/bolt/node/errors.rb
bolt-3.23.1 lib/bolt/node/errors.rb
bolt-3.23.0 lib/bolt/node/errors.rb
bolt-3.22.1 lib/bolt/node/errors.rb
bolt-3.22.0 lib/bolt/node/errors.rb
bolt-3.21.0 lib/bolt/node/errors.rb
bolt-3.20.0 lib/bolt/node/errors.rb
bolt-3.19.0 lib/bolt/node/errors.rb
bolt-3.18.0 lib/bolt/node/errors.rb