This repository was archived by the owner on Aug 19, 2025. It is now read-only.
fixed build issues + error handelling#56
Merged
algotyrnt merged 3 commits intoShiftSL:mainfrom Jun 8, 2025
Merged
Conversation
Merge branch 'main' of github.com:algotyrnt/backendShiftSL into dev
There was a problem hiding this comment.
Pull Request Overview
This PR addresses build issues and improves error handling in the backend service.
- Updates the getShiftSwap method to throw a custom exception when a shift swap is not found.
- Introduces a new ShiftSwapNotFoundException class.
- Modifies the pom.xml by removing the version from the Lombok exclusion to resolve build issues.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/com/shiftsl/backend/Service/ShiftSwapService.java | Updated error handling in getShiftSwap with a custom exception and message. |
| src/main/java/com/shiftsl/backend/Exceptions/ShiftSwapNotFoundException.java | Added a new exception class for missing shift swaps. |
| pom.xml | Removed a version declaration from a Lombok exclusion to fix build issues. |
Comments suppressed due to low confidence (1)
src/main/java/com/shiftsl/backend/Service/ShiftSwapService.java:36
- The exception thrown refers to ShiftNotFoundException, but the defined exception is ShiftSwapNotFoundException. Update the import and usage for consistency.
return shiftSwapRepo.findById(swapID).orElseThrow(() -> new ShiftNotFoundException("Shift swap " + swapID + "not found."));
|
|
||
| public ShiftSwap getShiftSwap(Long swapID){ | ||
| return shiftSwapRepo.findById(swapID).orElseThrow(); | ||
| return shiftSwapRepo.findById(swapID).orElseThrow(() -> new ShiftNotFoundException("Shift swap " + swapID + "not found.")); |
There was a problem hiding this comment.
Consider inserting a space before 'not found.' (e.g., "Shift swap " + swapID + " not found.") for better readability.
Suggested change
| return shiftSwapRepo.findById(swapID).orElseThrow(() -> new ShiftNotFoundException("Shift swap " + swapID + "not found.")); | |
| return shiftSwapRepo.findById(swapID).orElseThrow(() -> new ShiftNotFoundException("Shift swap " + swapID + " not found.")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.