Exception handling #82
@ -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();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user