[PR #43] [MERGED] Disambiguate "unauthorized" error from "blog_not_found" #73

Closed
opened 2026-10-13 19:46:53 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/43
Author: @KorespondentAda
Created: 7/26/2025
Status: ✅ Merged
Merged: 7/30/2025
Merged by: @Glitchy-Sheep

Base: dev ← Head: main


📝 Commits (10+)

  • 3be47a4 Disambiguate "unauthorized" error from "blog_not_found"
  • 10497c4 Disambiguate "unauthorized" error from "blog_not_found"
  • bffbf09 refactor: ♻️ Reformat doc comment and remove unused variable
  • 3ad99e5 refactor: ♻️ Better tests structure: remove unnecessary init files
  • 9d0e1e1 feat: ➕ Add pytest_asyncio to run some async integration tests
  • 384f47c test: ✅ Add some integration tests for the API, better structure for tests
  • 29c6ded feat: ✨ Update Makefile (add integration tests targets)
  • 8e6ac61 docs: 📝 Add ABOUT_TESTING.md for better understanding the tests structure/layout
  • 9730b7e fix: 🐛 Fix listing posts exception (some new post type failed validation process)
  • 01508c4 fix: 🐛 Fix pytest warning (import issues)

📊 Changes

21 files changed (+503 additions, -26 deletions)

View changed files

📝 .github/workflows/any-pr-validation.yaml (+8 -5)
📝 Makefile (+33 -13)
📝 boosty_downloader/main.py (+6 -0)
📝 boosty_downloader/src/boosty_api/core/client.py (+26 -6)
📝 boosty_downloader/src/boosty_api/models/post/base_post_data.py (+9 -1)
➕ boosty_downloader/src/boosty_api/models/post/post_data_types/post_data_header.py (+12 -0)
➕ boosty_downloader/src/boosty_api/models/post/post_data_types/post_data_list.py (+31 -0)
📝 boosty_downloader/src/download_manager/download_manager.py (+10 -0)
📝 poetry.lock (+34 -1)
📝 pyproject.toml (+1 -0)
➕ test/ABOUT_TESTING.md (+28 -0)
➕ test/integration/.env.example (+18 -0)
📝 test/integration/__init__.py (+0 -0)
📝 test/integration/analysis/__init__.py (+0 -0)
➕ test/integration/analysis/get_author_posts_test.py (+65 -0)
📝 test/integration/boosty_api/__init__.py (+0 -0)
➕ test/integration/boosty_api/boosty_api_test.py (+100 -0)
➕ test/integration/configuration.py (+24 -0)
➕ test/integration/fixtures.py (+98 -0)
➕ test/unit/__init__.py (+0 -0)

...and 1 more files

📄 Description

📌 Task

📝 Description

Currently any error returned from Boosty API treated as "User not found" error with respective error message by checking of presence data field in API response.
This is misleading if some other error occured, like unauthorized that is returned if config has wrong (or expired) credentials.
To disambiguate this kinds of errors from any others, there is different exceptions provided.

🔄 Changelog

  • ✨ Added: new exceptions for Boosty API errors: BoostyAPIUnauthorizedError, BoostyAPIUnknownError and respective error messages for user.
  • 🛠 Fixed: unauthorized error was treated as if it was blog_not_found.
  • 🔄 Changed: BoostyAPINoUsernameError now raised only if got blog_not_found error from API.

@Glitchy-Sheep UPD:

  • ✨ Added:
    • Placeholder support for new list/header types
    • Integration tests
  • 🛠 Fixed:
    • Validation error on new boosty response schema
  • 🔄 Changed:
    • Tests structure/layout (better than just mirror the project)

✅ Checklist

  • Locally tested
  • Documentation updated

@Glitchy-Sheep UPD: Removed some checklist items because of new CI and release cycle

⚠ Notes

I'm not a python programmer and maybe there is better way, I just tried to follow existing error handling scheme to extend it a bit.
Also there may be other errors from API that better be handled specificly, I far as I see they can be added in the same way.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/43 **Author:** [@KorespondentAda](https://github.com/KorespondentAda) **Created:** 7/26/2025 **Status:** ✅ Merged **Merged:** 7/30/2025 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (10+) - [`3be47a4`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/3be47a4218ea8218c806b1285c538cbad4844a98) Disambiguate "unauthorized" error from "blog_not_found" - [`10497c4`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/10497c459f20b7f83eb35ac614caf9fc26cdc226) Disambiguate "unauthorized" error from "blog_not_found" - [`bffbf09`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/bffbf09337ed901a741023fa0b0eec1137793d0b) refactor: :recycle: Reformat doc comment and remove unused variable - [`3ad99e5`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/3ad99e5899e3a9125243cc7f95ef8fb71ea71953) refactor: :recycle: Better tests structure: remove unnecessary init files - [`9d0e1e1`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/9d0e1e1a004ac46a26b54f05fbd955e91c1058cb) feat: :heavy_plus_sign: Add pytest_asyncio to run some async integration tests - [`384f47c`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/384f47c635a572141802c2df52d166471d30e220) test: :white_check_mark: Add some integration tests for the API, better structure for tests - [`29c6ded`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/29c6ded136864f84c9d8f7b6f9b6e85556e85741) feat: :sparkles: Update Makefile (add integration tests targets) - [`8e6ac61`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/8e6ac61837dd79aeb80487c8f46720d395b2151d) docs: :memo: Add ABOUT_TESTING.md for better understanding the tests structure/layout - [`9730b7e`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/9730b7e93955f5d26a5d2dfa85d03c2e15ec13e5) fix: :bug: Fix listing posts exception (some new post type failed validation process) - [`01508c4`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/01508c471e6cb886adff9a480ef356ca47919b6a) fix: :bug: Fix pytest warning (import issues) ### 📊 Changes **21 files changed** (+503 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/any-pr-validation.yaml` (+8 -5) 📝 `Makefile` (+33 -13) 📝 `boosty_downloader/main.py` (+6 -0) 📝 `boosty_downloader/src/boosty_api/core/client.py` (+26 -6) 📝 `boosty_downloader/src/boosty_api/models/post/base_post_data.py` (+9 -1) ➕ `boosty_downloader/src/boosty_api/models/post/post_data_types/post_data_header.py` (+12 -0) ➕ `boosty_downloader/src/boosty_api/models/post/post_data_types/post_data_list.py` (+31 -0) 📝 `boosty_downloader/src/download_manager/download_manager.py` (+10 -0) 📝 `poetry.lock` (+34 -1) 📝 `pyproject.toml` (+1 -0) ➕ `test/ABOUT_TESTING.md` (+28 -0) ➕ `test/integration/.env.example` (+18 -0) 📝 `test/integration/__init__.py` (+0 -0) 📝 `test/integration/analysis/__init__.py` (+0 -0) ➕ `test/integration/analysis/get_author_posts_test.py` (+65 -0) 📝 `test/integration/boosty_api/__init__.py` (+0 -0) ➕ `test/integration/boosty_api/boosty_api_test.py` (+100 -0) ➕ `test/integration/configuration.py` (+24 -0) ➕ `test/integration/fixtures.py` (+98 -0) ➕ `test/unit/__init__.py` (+0 -0) _...and 1 more files_ </details> ### 📄 Description # 📌 Task ## 📝 Description Currently any error returned from Boosty API treated as "User not found" error with respective error message by checking of presence `data` field in API response. This is misleading if some other error occured, like `unauthorized` that is returned if config has wrong (or expired) credentials. To disambiguate this kinds of errors from any others, there is different exceptions provided. ## 🔄 Changelog - **✨ Added:** new exceptions for Boosty API errors: `BoostyAPIUnauthorizedError`, `BoostyAPIUnknownError` and respective error messages for user. - **🛠 Fixed:** `unauthorized` error was treated as if it was `blog_not_found`. - **🔄 Changed:** `BoostyAPINoUsernameError` now raised only if got `blog_not_found` error from API. @Glitchy-Sheep UPD: - **✨ Added:** - Placeholder support for new list/header types - Integration tests - **🛠 Fixed:** - Validation error on new boosty response schema - **🔄 Changed:** - Tests structure/layout (better than just mirror the project) ## ✅ Checklist - [X] Locally tested - [x] Documentation updated @Glitchy-Sheep UPD: Removed some checklist items because of new CI and release cycle ## ⚠ Notes I'm not a python programmer and maybe there is better way, I just tried to follow existing error handling scheme to extend it a bit. Also there may be other errors from API that better be handled specificly, I far as I see they can be added in the same way. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:46:53 +00:00
Sign in to join this conversation.
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
Glitchy-Sheep/boosty-downloader#73
No description provided.