Exception: Scalyr::Common::Client::ServerError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/scalyr/common/client.rb

Overview


An exception representing a Scalyr server-side error that occurs during upload attempt


Direct Known Subclasses

RequestDroppedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, code = nil, url = nil, body = nil, e_class = "Scalyr::Common::Client::ServerError") ⇒ ServerError

Returns a new instance of ServerError.


13
14
15
16
17
18
19
# File 'lib/scalyr/common/client.rb', line 13

def initialize(msg=nil, code=nil, url=nil, body=nil, e_class="Scalyr::Common::Client::ServerError")
  super(msg)
  @code = code.to_i
  @url = url
  @body = body
  @e_class = e_class
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.


11
12
13
# File 'lib/scalyr/common/client.rb', line 11

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.


11
12
13
# File 'lib/scalyr/common/client.rb', line 11

def code
  @code
end

#e_classObject (readonly)

Returns the value of attribute e_class.


11
12
13
# File 'lib/scalyr/common/client.rb', line 11

def e_class
  @e_class
end

#urlObject (readonly)

Returns the value of attribute url.


11
12
13
# File 'lib/scalyr/common/client.rb', line 11

def url
  @url
end

Instance Method Details

#is_commonly_retried?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/scalyr/common/client.rb', line 21

def is_commonly_retried?
  [503, 502, 409].include? @code
end