wagtail-nest / wagtail-airtable

Airtable import and export support for Wagtail pages and Django models.
BSD 3-Clause "New" or "Revised" License
49 stars 15 forks source link

Wrap a try/catch around the split in the line referenced in this PR #25

Closed KalobTaulien closed 3 years ago

KalobTaulien commented 3 years ago

When there's an error, we split the error and parse it. But if there arent 2 parts to the split() it will fail spectacularly.

Below is the line that needs a try/catch around it, will a fallback error message. https://github.com/wagtail/wagtail-airtable/blob/938484513bd43828973ebcd61f7a055005dff393/wagtail_airtable/mixins.py#L288

Example error:

('503 Server Error: Service Unavailable for url: https://api.airtable.com/v0/appXXXXXXXX/BaseName', '503 Server Error: Service Unavailable for url: https://api.airtable.com/v0/appXXXXXXX/BaseName')
bmoe872 commented 3 years ago

We just got this as well on our projects. Throws a lot of errors when Airtable decides not to work.

KalobTaulien commented 3 years ago

@bmoe872 Yeah bad timing, I got this in the middle of a big demo haha. But it's good this came up. I added a string matching conditional to check for "503 Server Error" in the error response. Closing this ticket (but please open another one with the traceback if you end up getting this again before I do).