From cbab85c7c00653305c54771b1bd76f7e99f18fca Mon Sep 17 00:00:00 2001
From: Jonas <jonas.fischer14@gmx.de>
Date: Mon, 18 Dec 2023 15:38:49 +0100
Subject: [PATCH] 18.12.2023 - create custom Exceptions #25

---
 .../exeptions/PlayerIdNotFoundException.java           |  6 ++++--
 .../exeptions/TournamentIdNotFoundException.java       | 10 ++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/TournamentIdNotFoundException.java

diff --git a/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/PlayerIdNotFoundException.java b/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/PlayerIdNotFoundException.java
index 59f5501..8f4ae10 100644
--- a/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/PlayerIdNotFoundException.java
+++ b/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/PlayerIdNotFoundException.java
@@ -1,7 +1,9 @@
 package hdm.mi.sthbackend.exeptions;
 
+import java.util.UUID;
+
 public class PlayerIdNotFoundException extends Exception {
-    public PlayerIdNotFoundException (String playerId) {
-        super(String.format("PlayerId %s not found", playerId));
+    public PlayerIdNotFoundException (UUID playerId) {
+        super(String.format("PlayerId %s not found", playerId.toString()));
     }
 }
diff --git a/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/TournamentIdNotFoundException.java b/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/TournamentIdNotFoundException.java
new file mode 100644
index 0000000..85f5a24
--- /dev/null
+++ b/sth-backend/src/main/java/hdm/mi/sthbackend/exeptions/TournamentIdNotFoundException.java
@@ -0,0 +1,10 @@
+package hdm.mi.sthbackend.exeptions;
+
+import java.util.UUID;
+
+public class TournamentIdNotFoundException extends Exception{
+    public TournamentIdNotFoundException(UUID tournamentId) {
+        super(String.format("TournamentId %s not found", tournamentId.toString()));
+
+    }
+}
-- 
GitLab