Skip to content

Enhance AxmeAuthError messages for status codes 401 and 403#41

Open
vivan070707-ctrl wants to merge 3 commits intoAxmeAI:mainfrom
vivan070707-ctrl:vivan070707-ctrl-patch-1
Open

Enhance AxmeAuthError messages for status codes 401 and 403#41
vivan070707-ctrl wants to merge 3 commits intoAxmeAI:mainfrom
vivan070707-ctrl:vivan070707-ctrl-patch-1

Conversation

@vivan070707-ctrl
Copy link

This PR improves error messages for authentication failures.

  • 401: Invalid API key (clear message added)
  • 403: Access denied (permission issue clarified)

This improves developer experience by providing more meaningful feedback.

Improve error messages for 401 and 403 auth failures
@George-iam
Copy link
Contributor

Good direction! A couple of things to adjust:

  1. Don't replace the server message entirely - the server may return useful details like "API key expired" or "actor_token required for this route". Instead, prepend the user-friendly hint:

    message = f"API key invalid - check AXME_API_KEY or run `axme login`. Server: {message}"
  2. Keep the original message as fallback context so users can debug.

  3. Add a test case in tests/test_client.py - mock a 401 response and verify the exception message contains both the hint and server detail.

Fix: prepend user-friendly hint while preserving server message for 401/403
Test: add 401 error message test to verify hint and server message
@vivan070707-ctrl
Copy link
Author

I have updated it again you want any further changes ples tell
Thank you

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.

2 participants