Exception: JPush::Utils::Exceptions::JPushResponseError

Inherits:
JPushError
  • Object
show all
Defined in:
lib/jpush/utils/exceptions.rb

Direct Known Subclasses

VIPAppKeyError

Instance Attribute Summary collapse

Attributes inherited from JPushError

#message

Instance Method Summary collapse

Constructor Details

#initialize(http_code, error_code, error_message) ⇒ JPushResponseError

Returns a new instance of JPushResponseError.



55
56
57
58
59
# File 'lib/jpush/utils/exceptions.rb', line 55

def initialize(http_code, error_code, error_message)
  @http_code, @error_code, @error_message = http_code, error_code, error_message
  @error_message = "UnknownError[#{@http_code}]." if @error_message.blank?
  super("#{@error_message} (error code: #{@error_code}) ")
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



53
54
55
# File 'lib/jpush/utils/exceptions.rb', line 53

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



53
54
55
# File 'lib/jpush/utils/exceptions.rb', line 53

def error_message
  @error_message
end

#http_codeObject (readonly)

Returns the value of attribute http_code.



53
54
55
# File 'lib/jpush/utils/exceptions.rb', line 53

def http_code
  @http_code
end

Instance Method Details

#to_sObject



61
62
63
# File 'lib/jpush/utils/exceptions.rb', line 61

def to_s
  "#{@message}. http status code: #{@http_code}"
end