Skip to content

FAC-33 feat: add Moodle connectivity error handling with timeouts#59

Merged
y4nder merged 1 commit intodevelopfrom
feat/fac-33
Feb 25, 2026
Merged

FAC-33 feat: add Moodle connectivity error handling with timeouts#59
y4nder merged 1 commit intodevelopfrom
feat/fac-33

Conversation

@y4nder
Copy link
Member

@y4nder y4nder commented Feb 25, 2026

When Moodle is unreachable or times out, the API now returns a clear 401 Unauthorized with "Moodle service is currently unreachable" instead of a generic 500 error. This improves frontend error handling and server-side debugging with detailed logging.

  • Add MoodleConnectivityError custom error class with 10s request timeout
  • Catch connectivity errors in AuthService.Login and map to 401 response
  • Enhance logging in MoodleSyncService and MoodleUserHydrationService
  • Add 5 unit tests for connectivity error scenarios

When Moodle is unreachable or times out, the API now returns a clear
401 Unauthorized with "Moodle service is currently unreachable" instead
of a generic 500 error. This improves frontend error handling and
server-side debugging with detailed logging.
- Add MoodleConnectivityError custom error class with 10s request
timeout  - Catch connectivity errors in AuthService.Login and map to 401
response  - Enhance logging in MoodleSyncService and
MoodleUserHydrationService  - Add 5 unit tests for connectivity error
scenarios
@y4nder y4nder self-assigned this Feb 25, 2026
@y4nder y4nder merged commit 7962e1a into develop Feb 25, 2026
2 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