Exception: Puppet::Network::HTTP::Error::HTTPError

Inherits:
Exception
  • Object
show all
Defined in:
lib/puppet/network/http/error.rb

Overview

rubocop:disable Lint/InheritException

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status, issue_kind) ⇒ HTTPError

Returns a new instance of HTTPError.



11
12
13
14
15
# File 'lib/puppet/network/http/error.rb', line 11

def initialize(message, status, issue_kind)
  super(message)
  @status = status
  @issue_kind = issue_kind
end

Instance Attribute Details

#issue_kindObject (readonly)

Returns the value of attribute issue_kind.



9
10
11
# File 'lib/puppet/network/http/error.rb', line 9

def issue_kind
  @issue_kind
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/puppet/network/http/error.rb', line 9

def status
  @status
end

Instance Method Details

#to_jsonObject



17
18
19
# File 'lib/puppet/network/http/error.rb', line 17

def to_json
  Puppet::Util::Json.dump({ :message => message, :issue_kind => @issue_kind })
end