forgeplus/app/libs/wechat/error.rb

14 lines
233 B
Ruby

class Wechat::Error < StandardError
attr_reader :code
def initialize(code, message)
super message
@code = code
end
class << self
def parse(result)
new(result['errcode'], result['errmsg'])
end
end
end