Exception: Puppet::Network::HTTP::Error::HTTPServerError

Inherits:
HTTPError show all
Defined in:
lib/puppet/network/http/error.rb

Constant Summary collapse

CODE =
500

Instance Attribute Summary collapse

Attributes inherited from HTTPError

#issue_kind, #status

Instance Method Summary collapse

Methods inherited from Exception

#to_zaml, yaml_new

Constructor Details

#initialize(original_error, issue_kind = Issues::RUNTIME_ERROR) ⇒ HTTPServerError

Returns a new instance of HTTPServerError.



60
61
62
63
# File 'lib/puppet/network/http/error.rb', line 60

def initialize(original_error, issue_kind = Issues::RUNTIME_ERROR)
  super("Server Error: " + original_error.message, CODE, issue_kind)
  @backtrace = original_error.backtrace
end

Instance Attribute Details

#backtraceObject (readonly)



58
59
60
# File 'lib/puppet/network/http/error.rb', line 58

def backtrace
  @backtrace
end

Instance Method Details

#to_jsonObject



65
66
67
# File 'lib/puppet/network/http/error.rb', line 65

def to_json
  JSON({:message => message, :issue_kind => @issue_kind, :stacktrace => self.backtrace})
end