Exception: Artifactory::Error::HTTPError

Inherits:
ArtifactoryError show all
Defined in:
lib/artifactory/errors.rb

Overview

Class for all HTTP errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ HTTPError

Returns a new instance of HTTPError.



26
27
28
29
30
31
32
# File 'lib/artifactory/errors.rb', line 26

def initialize(hash = {})
  @code = hash['status'].to_i
  @http = hash['message'].to_s

  super "The Artifactory server responded with an HTTP Error " \
        "#{@code}: `#{@http}'"
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



24
25
26
# File 'lib/artifactory/errors.rb', line 24

def code
  @code
end