secana/ForgejoKit
3
11
Fork
You've already forked ForgejoKit
3

fix: classify auth and service errors #2

Merged
secana merged 1 commit from pdurlej/ForgejoKit:codex/typed-auth-server-errors into main 2026年05月12日 17:41:25 +02:00
Contributor
Copy link

Problem

  • Callers currently need to inspect raw status codes to distinguish authentication, permission, not-found, and server failures.

Change

  • Adds a small HTTPErrorCategory for 401, 403, 404, and 5xx responses.
  • Exposes httpStatusCode and httpErrorCategory on ServiceError and AuthenticationError.
  • Keeps the existing AuthenticationError cases intact and centralizes status-to-auth-error mapping.

Tests

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test
Problem - Callers currently need to inspect raw status codes to distinguish authentication, permission, not-found, and server failures. Change - Adds a small HTTPErrorCategory for 401, 403, 404, and 5xx responses. - Exposes httpStatusCode and httpErrorCategory on ServiceError and AuthenticationError. - Keeps the existing AuthenticationError cases intact and centralizes status-to-auth-error mapping. Tests - DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
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
secana/ForgejoKit!2
Reference in a new issue
secana/ForgejoKit
No description provided.
Delete branch "pdurlej/ForgejoKit:codex/typed-auth-server-errors"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?