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) ⇒ ServerError



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

def initialize(msg=nil, code=nil, url=nil, body=nil)
  super(msg)
  @code = code.to_i
  @url = url
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/scalyr/common/client.rb', line 8

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/scalyr/common/client.rb', line 8

def code
  @code
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/scalyr/common/client.rb', line 8

def url
  @url
end

Instance Method Details

#is_commonly_retried?Boolean



17
18
19
# File 'lib/scalyr/common/client.rb', line 17

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