Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit 82fbeda

Browse files
authored
Merge pull request #56 from algotyrnt/dev
fixed build issues + error handelling
2 parents a75bfb8 + 151c0a2 commit 82fbeda

3 files changed

Lines changed: 20 additions & 13 deletions

File tree

pom.xml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,17 @@
142142
</configuration>
143143
</plugin>
144144
<plugin>
145-
<groupId>org.springframework.boot</groupId>
146-
<artifactId>spring-boot-maven-plugin</artifactId>
147-
<configuration>
148-
<excludes>
149-
<exclude>
150-
<groupId>org.projectlombok</groupId>
151-
<artifactId>lombok</artifactId>
152-
<version>1.18.36</version>
153-
</exclude>
154-
</excludes>
155-
</configuration>
156-
</plugin>
145+
<groupId>org.springframework.boot</groupId>
146+
<artifactId>spring-boot-maven-plugin</artifactId>
147+
<configuration>
148+
<excludes>
149+
<exclude>
150+
<groupId>org.projectlombok</groupId>
151+
<artifactId>lombok</artifactId>
152+
</exclude>
153+
</excludes>
154+
</configuration>
155+
</plugin>
157156
</plugins>
158157
</build>
159158
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.shiftsl.backend.Exceptions;
2+
3+
public class ShiftSwapNotFoundException extends RuntimeException {
4+
public ShiftSwapNotFoundException(String message) {
5+
super(message);
6+
}
7+
}

src/main/java/com/shiftsl/backend/Service/ShiftSwapService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.shiftsl.backend.Service;
22

3+
import com.shiftsl.backend.Exceptions.ShiftNotFoundException;
34
import com.shiftsl.backend.model.Shift;
45
import com.shiftsl.backend.model.ShiftSwap;
56
import com.shiftsl.backend.model.StatusSwap;
@@ -32,7 +33,7 @@ public ShiftSwap requestSwap(Long sDocID, Long rDocID, Long shiftID) {
3233
}
3334

3435
public ShiftSwap getShiftSwap(Long swapID){
35-
return shiftSwapRepo.findById(swapID).orElseThrow();
36+
return shiftSwapRepo.findById(swapID).orElseThrow(() -> new ShiftNotFoundException("Shift swap " + swapID + "not found."));
3637
}
3738

3839
public String accept(Long swapID) {

0 commit comments

Comments
 (0)