Closed shir closed 2 years ago
I came here with similar problems and the solution seems reasonable to me.
@andheiberg-babylonhealth : while @shir 's suggestion makes a lot of sense, I wasn't able to reproduce this specific error in the issue description.
Would you have a more updated code I can use for my testing?
Thank you.
2018 error that can't be reproduced. Closing for now, please feel free to re-open and provide an example to reproduce, if you have the same error.
When I build a new request:
I got error:
It happens here
zendesk_api-1.14.2/lib/zendesk_api/collection.rb" line 166 in <<
.I've investigated a bit and found that this happens because
@resources
isnil
. I've tried to figure out why it's nil and found only one scenario. In method<<
at first stepfetch
is called to fill@resources
butfetch
callsfetch!
and ifFaraday::Error::ClientError
appear then[]
is returned, but@resources
is not set (I guessfetch
in case of error should assign[]
to@resources
before return it). And I've tried to reproduce this behaviour by turning off network on my machine and got same result - exception "NoMethodError: undefined method `<<' for nil:NilClass".I think in case
Faraday::Error::ClientError
it should not be silences (at least whenbuild
is called) and should raise exception with information why this happen. In my case I suspect that issue is not with internet connection because user make other request via API successfully, but I can't get any information about issue.