Exception: Wechat::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/wechat/error.rb

Overview

Custom error class for rescuing from Wechat errors

Direct Known Subclasses

BadRequest, InternalServerError, Unauthorized

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
# File 'lib/wechat/error.rb', line 5

def initialize(code)
  @code = code

  super(build_error_message)
end

Instance Method Details

#build_error_messageObject



11
12
13
# File 'lib/wechat/error.rb', line 11

def build_error_message
  "HTTP-Code: #{@code}"
end