prismicio-community/ruby-kit

EOF error when fetching documents with broken links

Opened this issue · 1 comments

Hey, everyone!

My team uses the following code to fetch all documents in our Prismic repository:

client = Prismic.api('https://<my_repo_host>/api')
response = client.all({ 'page' => current_page, 'pageSize' => 100 })

This worked well us until we started getting EOF errors from the client.all call. After a little bit of digging around, I discovered that it was caused by a broken link in a single document:

image

For context, this was a Content Relationship field linking to a now-archived internal document.

Would it be possible to update this Gem to handle this a little more gracefully, like maybe adding a nested error field for the offending document or even just returning nil for its body? The alternative solution that we have is just querying documents one by one and skipping the document when we run into the EOFError, which is possible but not preferable.

Thanks in advance! I'm also happy to add more details if needed.

Hi @stephenkao, could you write a test that recreates this issue?