Skip to content

fix: surface UniFi API error payloads - #21

Merged
tnware merged 1 commit into
mainfrom
test/api-error-handling-baseline
May 26, 2026
Merged

tnware merged 1 commit into
mainfrom
test/api-error-handling-baseline

Conversation

@tnware

@tnware tnware commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Treat UniFi API JSON error payloads (meta.rc == "error") as UnifiAPIError instead of returning empty data.
  • Add focused response-processing tests for success, malformed data, and UniFi API-level errors.

Test Plan

  • ruff check .
  • pytest -q
  • python -m build
  • twine check dist/*
  • sphinx-build -E -W -b html docs docs/_build/html
  • git diff --check

Notes

This is the first runtime safety follow-up after the maintainer-baseline PR. It is intentionally narrow: API-level failures returned as HTTP 200 should not be silently interpreted as successful empty data.

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tnware, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 29 minutes and 43 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a117284c-1d53-49f3-aab8-7972d8f168e3

📥 Commits

Reviewing files that changed from the base of the PR and between 820a70c and 80272ed.

📒 Files selected for processing (2)
  • tests/test_api_response_handling.py
  • unifi_controller_api/api_client.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/api-error-handling-baseline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tnware
tnware merged commit 0ba396f into main May 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant