Exception handling #82

Open
stne3960 wants to merge 6 commits from feature/exception-handling into main
Owner

This PR adds centralized exception handling with RFC 7807 Problem Details, aligning with https://gitea.dsv.su.se/DMC/api-spec/src/branch/main/daisy/grupprumsbokning.md

It introduces StudentportalenException as the abstract base exception class for all BFF errors. Each subclass defines:

  • getType() - URI identifying the error type (e.g., studentportalen:forbidden)
  • getTitle() - Short human-readable summary
  • getStatus() - HTTP status code

Adds specific exception types: ValidationException, ForbiddenException, and ServiceUnavailableException for now.
Implements GlobalExceptionHandler to convert exceptions to RFC 7807 format.
Adds spring-boot-starter-validation dependency for @Valid support

This PR adds centralized exception handling with RFC 7807 Problem Details, aligning with https://gitea.dsv.su.se/DMC/api-spec/src/branch/main/daisy/grupprumsbokning.md It introduces `StudentportalenException` as the abstract base exception class for all BFF errors. Each subclass defines: - getType() - URI identifying the error type (e.g., `studentportalen:forbidden`) - getTitle() - Short human-readable summary - getStatus() - HTTP status code Adds specific exception types: `ValidationException`, `ForbiddenException`, and `ServiceUnavailableException` for now. Implements `GlobalExceptionHandler` to convert exceptions to RFC 7807 format. Adds `spring-boot-starter-validation` dependency for `@Valid` support
stne3960 added 6 commits 2026-01-30 11:49:20 +01:00
stne3960 requested review from ansv7779 2026-01-30 11:51:09 +01:00
stne3960 added the
Code Review
label 2026-01-30 11:51:17 +01:00
First-time contributor
Deployed to https://studentportalen-feature-exception-handling.branch.dsv.su.se
All checks were successful
Code style BFF / check (pull_request) Successful in 1m28s
Deploy to branch.dsv.su.se / deploy (pull_request) Successful in 5m19s
This pull request doesn't have enough required approvals yet. 0 of 1 official approvals granted.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/exception-handling:feature/exception-handling
git checkout feature/exception-handling
Sign in to join this conversation.
No Reviewers
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DMC/studentportalen#82
No description provided.