Update metadata exception types to catch TypeErrors #19

Merged
buckbanzai merged 2 commits from update-metadata-exceptions into main 2024-02-14 07:53:00 -08:00
Owner

The changes introduced in 3c3b580496 caught NameErrors on the metadata fields (post IDs, tags), but didn't account for if the <script> tags that contain them weren't found at all.

In that case, BeautifulSoup returns a None type, which when we then try to access the tag's attributes. This PR fixes that by adding TypeError to the excepts.

The changes introduced in 3c3b580496eb3c24fca9c7fd4cc06f26e011692c caught `NameError`s on the metadata fields (post IDs, tags), but didn't account for if the <script\> tags that contain them weren't found at all. In that case, BeautifulSoup returns a `None` type, which when we then try to access the tag's attributes. This PR fixes that by adding `TypeError` to the excepts.
buckbanzai added 2 commits 2024-02-14 07:45:20 -08:00
Merge remote-tracking branch 'origin/main' into update-metadata-exceptions
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pull_request_closed/lint Pipeline was successful
9a52805213
buckbanzai scheduled this pull request to auto merge when all checks succeed 2024-02-14 07:46:17 -08:00
buckbanzai changed title from Update metadata exception types to catch multiple potential errors to Update metadata exception types to catch TypeErrors 2024-02-14 07:48:52 -08:00
buckbanzai canceled auto merging this pull request when all checks succeed 2024-02-14 07:51:01 -08:00
buckbanzai merged commit 257d61aefc into main 2024-02-14 07:53:00 -08:00
buckbanzai deleted branch update-metadata-exceptions 2024-02-14 07:53:00 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: buckbanzai/kuow-mastodon-bot#19
No description provided.