You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AuthorizationError does not say whether it was a 401 or a 403 #805
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt:
yes [to drafting caldav issues for two findings of the calendaring 2.1 code review]
base_client._raise_authorization_error() builds the AuthorizationError from url, reason, preconditions and body. The HTTP status is dropped. A caller cannot tell "bad or missing credentials" (401) from "authenticated, but not allowed" (403) except by guessing from the reason phrase, which servers word freely.
calendaring maps these to two different exceptions (AuthenticationError and AuthorizationError). It currently reads exc.status, so today every 401 ends up as an authorisation error: PyCalendar/calendaring#13.
Suggested fix: set status on the exception, from reason_source.status (niquests/requests) or reason_source.status_code (httpx). It could go on DAVError generally, since error_from_response() has the response at hand too.
Activity
refactor: use caldav 3.6 error attributes (2.1)
refactor: use caldav 3.6 error attributes (2.1)