diff --git a/lib/passwordstate/client.rb b/lib/passwordstate/client.rb index ef808e71dab1ce27af78918b2cc763db37290e4e..1153aae1a8c4669c14643a0efe2b0c7602877d14 100644 --- a/lib/passwordstate/client.rb +++ b/lib/passwordstate/client.rb @@ -105,8 +105,9 @@ module Passwordstate return data if res_obj.is_a? Net::HTTPSuccess data = data&.first + data = data.fetch('errors', []) if data.is_a? Hash - raise Passwordstate::HTTPError.new_by_code(res_obj.code, req_obj, res_obj, data&.fetch('errors', []) || []) + raise Passwordstate::HTTPError.new_by_code(res_obj.code, req_obj, res_obj, data || []) else return res_obj.body if res_obj.is_a?(Net::HTTPSuccess) && options.fetch(:allow_html, true)