Sha256: a5dad4025dc2dfe85bc917359b77cee6c1ddda583ea323cdd6c4f3d3e00d0256
Contents?: true
Size: 414 Bytes
Versions: 6
Compression:
Stored size: 414 Bytes
Contents
# frozen_string_literal: true module NovaposhtaApi module Middlewares class ParseJson < Faraday::Response::Middleware def on_complete(env) process_response(env) end def process_response(env) env[:body] = JSON.parse(env[:body]) rescue Faraday::ParsingError => e raise Faraday::ParsingError.new(e.wrapped_exception, env[:response]) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems