Sha256: 9d887cde4f87b960e04a54367e1d5d9ddcec004691c1886e71f2ae729eeffd2f
Contents?: true
Size: 613 Bytes
Versions: 24
Compression:
Stored size: 613 Bytes
Contents
module Onfido class OnfidoError < StandardError attr_accessor :response_code, :response_body def initialize(message = nil, response_code: nil, response_body: nil) @response_code = response_code @response_body = response_body super(message) end def json_body JSON.parse(response_body.to_s) rescue JSON::ParserError nil end def type json_body && json_body['error'] && json_body['error']['type'] end def fields json_body && json_body['error'] && json_body['error']['fields'] end end end
Version data entries
24 entries across 24 versions & 1 rubygems