Sha256: 26f5d6abb2551d82aa452fb1f74c5b0698b63e9cb8114fead32ea4d9e07ab3a4
Contents?: true
Size: 742 Bytes
Versions: 14
Compression:
Stored size: 742 Bytes
Contents
class OpenpayException < StandardError attr_reader :description attr_reader :http_code attr_reader :http_body attr_reader :json_body attr_reader :error_code attr_reader :category def initialize(message=nil,json_message=true) #openpay errors have a json error string if json_message json= JSON.parse message @description = json['description'] @http_code = json['http_code'] @error_code = json['error_code'] @json_body = message @category = json['category'] #other errors may or not have a json error string, so this case is for them else @description = message @http_code = '' @http_body = '' @json_body = '' @error_code = '' end end end
Version data entries
14 entries across 12 versions & 1 rubygems