mirror of
https://github.com/PaulReichmuth/timekeep-backend.git
synced 2026-02-05 20:43:27 +00:00
made exception interfaces
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
|
||||
public class ExistsException extends RuntimeException {
|
||||
public ExistsException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
|
||||
public class NotFoundException extends RuntimeException {
|
||||
public NotFoundException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import de.pnreichmuth.timekeep_backend.entities.Team;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class RacerExistsException extends RuntimeException {
|
||||
public class RacerExistsException extends ExistsException {
|
||||
public RacerExistsException(String message, Racer racer) {
|
||||
super(message);
|
||||
log.warn(message, racer.getFirstName(), racer.getLastName());
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Slf4j
|
||||
public class RacerNotFoundException extends RuntimeException {
|
||||
public class RacerNotFoundException extends NotFoundException {
|
||||
public RacerNotFoundException(String message) {
|
||||
super(message);
|
||||
log.error(message);
|
||||
|
||||
@@ -4,7 +4,7 @@ import de.pnreichmuth.timekeep_backend.entities.Station;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class StationExistsException extends RuntimeException {
|
||||
public class StationExistsException extends ExistsException {
|
||||
public StationExistsException(String message, Station station) {
|
||||
super(message);
|
||||
log.warn(message, station.getName(), station.getLocation());
|
||||
|
||||
@@ -3,7 +3,7 @@ package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class StationNotFoundException extends RuntimeException {
|
||||
public class StationNotFoundException extends NotFoundException {
|
||||
public StationNotFoundException(String message) {
|
||||
super(message);
|
||||
log.error(message);
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Slf4j
|
||||
public class TeamExistsException extends RuntimeException {
|
||||
public class TeamExistsException extends ExistsException {
|
||||
public TeamExistsException(String message, Team team) {
|
||||
super(message);
|
||||
log.warn(message, team.getTeamName());
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Slf4j
|
||||
public class TeamNotFoundException extends RuntimeException {
|
||||
public class TeamNotFoundException extends NotFoundException {
|
||||
public TeamNotFoundException(String message) {
|
||||
super(message);
|
||||
log.error(message);
|
||||
|
||||
Reference in New Issue
Block a user