Exception: PuppetX::Puppetlabs::Swagger::PrefetchError

Inherits:
Exception
  • Object
show all
Defined in:
lib/puppet_x/puppetlabs/swagger/prefetch_error.rb

Overview

We purposefully inherit from Exception here due to PUP-3656 If we throw something based on StandardError prior to Puppet 4 the exception will prevent the prefetch, but the provider will continue to run with incorrect data.

Instance Method Summary (collapse)

Constructor Details

Method: PuppetX::Puppetlabs::Swagger::PrefetchError#initialize

Defined in:
lib/puppet_x/puppetlabs/swagger/prefetch_error.rb

- (PrefetchError) initialize(type, exception = nil)

Returns a new instance of PrefetchError



9
10
11
12
# File 'lib/puppet_x/puppetlabs/swagger/prefetch_error.rb', line 9

def initialize(type, exception=nil)
  @type = type
  @exception = exception
end

Instance Method Details

Method: PuppetX::Puppetlabs::Swagger::PrefetchError#to_s

Defined in:
lib/puppet_x/puppetlabs/swagger/prefetch_error.rb

- (Object) to_s



14
15
16
17
18
19
20
# File 'lib/puppet_x/puppetlabs/swagger/prefetch_error.rb', line 14

def to_s
  """Puppet detected a problem with the information returned from the service when accessing #{@type}. The specific error was:
  #{@exception.message}

  #{@exception.backtrace.join("\n")}
  """
end