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.



10
11
12
13
14
15
16
# File 'lib/artifactory/errors.rb', line 10

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.



8
9
10
# File 'lib/artifactory/errors.rb', line 8

def code
  @code
end