Sha256: 39acb49379353101a04db762152cfebb03f2ac0d3b128e7d1bc7fa1b7113c23d
Contents?: true
Size: 492 Bytes
Versions: 5
Compression:
Stored size: 492 Bytes
Contents
module EtCcdClient module Exceptions class UnprocessableEntity < Base def to_s json = JSON.parse(response.body) rescue JSON::JSONError return super if json.nil? || json == JSON::JSONError field_errors = json.dig('details', 'field_errors')&.map do |field_error| "#{field_error['id']} => #{field_error['message']}" end return super if field_errors.nil? "#{super} - #{field_errors.join(', ')}" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems