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-1.24.0 lib/bolt/node/errors.rb
bolt-1.23.0 lib/bolt/node/errors.rb
bolt-1.22.0 lib/bolt/node/errors.rb
bolt-1.21.0 lib/bolt/node/errors.rb
bolt-1.20.0 lib/bolt/node/errors.rb
bolt-1.19.0 lib/bolt/node/errors.rb
bolt-1.18.0 lib/bolt/node/errors.rb
bolt-1.17.0 lib/bolt/node/errors.rb
bolt-1.16.0 lib/bolt/node/errors.rb
bolt-1.15.0 lib/bolt/node/errors.rb
bolt-1.14.0 lib/bolt/node/errors.rb
bolt-1.13.1 lib/bolt/node/errors.rb
bolt-1.13.0 lib/bolt/node/errors.rb
bolt-1.12.0 lib/bolt/node/errors.rb
bolt-1.11.0 lib/bolt/node/errors.rb
bolt-1.10.0 lib/bolt/node/errors.rb
bolt-1.9.0 lib/bolt/node/errors.rb
bolt-1.8.1 lib/bolt/node/errors.rb
bolt-1.8.0 lib/bolt/node/errors.rb
bolt-1.7.0 lib/bolt/node/errors.rb