Exception: JPush::Utils::Exceptions::JPushResponseError
- Inherits:
-
JPushError
- Object
- StandardError
- JPushError
- JPush::Utils::Exceptions::JPushResponseError
- Defined in:
- lib/jpush/utils/exceptions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
Attributes inherited from JPushError
Instance Method Summary collapse
-
#initialize(http_code, error_code, error_message) ⇒ JPushResponseError
constructor
A new instance of JPushResponseError.
- #to_s ⇒ Object
Constructor Details
#initialize(http_code, error_code, error_message) ⇒ JPushResponseError
Returns a new instance of JPushResponseError.
56 57 58 59 60 |
# File 'lib/jpush/utils/exceptions.rb', line 56 def initialize(http_code, error_code, ) @http_code, @error_code, @error_message = http_code, error_code, @error_message = "UnknownError[#{@http_code}]." if @error_message.blank? super("#{@error_message} (error code: #{@error_code}) ") end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
54 55 56 |
# File 'lib/jpush/utils/exceptions.rb', line 54 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
54 55 56 |
# File 'lib/jpush/utils/exceptions.rb', line 54 def @error_message end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
54 55 56 |
# File 'lib/jpush/utils/exceptions.rb', line 54 def http_code @http_code end |
Instance Method Details
#to_s ⇒ Object
62 63 64 |
# File 'lib/jpush/utils/exceptions.rb', line 62 def to_s "#{@message}. http status code: #{@http_code}" end |