Exception handling #82

Merged
stne3960 merged 6 commits from feature/exception-handling into main 2026-02-02 11:18:37 +01:00
Showing only changes of commit 3c3508a956 - Show all commits

View File

@ -0,0 +1,34 @@
package se.su.dsv.studentportalen.bff.exception;
import org.springframework.http.HttpStatus;
/**
* Base exception for all Studentportalen BFF errors.
* Subclasses define specific error types that map to RFC 7807 Problem Details.
*/
public abstract class StudentportalenException extends RuntimeException {
protected StudentportalenException(String message) {
super(message);
}
protected StudentportalenException(String message, Throwable cause) {
super(message, cause);
}
/**
* The error type URI for RFC 7807 Problem Details.
* Example: "studentportalen:validation-error"
*/
public abstract String getType();
/**
* A short, human-readable summary of the problem type.
*/
public abstract String getTitle();
/**
* The HTTP status code for this error.
*/
public abstract HttpStatus getStatus();
}