lib/pdfmonkey/adapter.rb in pdfmonkey-0.3.0 vs lib/pdfmonkey/adapter.rb in pdfmonkey-0.4.0
- old
+ new
@@ -35,10 +35,12 @@
JSON.parse(response.body).fetch(member)
end
private def extract_errors(response)
payload = JSON.parse(response.body)
- { errors: payload['errors'], status: 'error' }
+ errors = payload['errors'].to_a.map { |error| error['detail'] }
+
+ { errors: errors, status: 'error' }
end
private def headers
{
'Authorization' => "Bearer #{config.private_key}",