Desk.com API seems to be overloaded some times and shuts down a request in nginx by returning a DeskApi::Error::BadRequest. In those cases we should just retry the request.
In fbd0eef we added a rescue that raises a NoMethodError for all errors happening within the method and the block. If there is an error within the block it should bubble through. Therefore we need to make sure to only raise the error if it happens while we assign the first page.
defeach_pageraiseArgumentError,"Block must be given for #each_page"unlessblock_given?beginpage=self.first.per_page(self.query_params['per_page'] || 1000).duprescueNoMethodErrorraiseNoMethodError,"#each_page and #all are only available on resources which offer pagination"endbeginyieldpage,page.pageendwhilepage.next!end
We should start and create a wiki for the documentation. That'll allow us to be more clear and have more examples. @oheyandy do you want to run point on this?