Skip to content
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
algotyrnt:dev
Jun 8, 2025
Merged

fixed build issues + error handelling#56
algotyrnt merged 3 commits intoShiftSL:mainfrom
algotyrnt:dev

Conversation

@algotyrnt
Copy link
Copy Markdown
Member

No description provided.

algotyrnt and others added 3 commits April 9, 2025 16:12
Merge branch 'main' of github.com:algotyrnt/backendShiftSL into dev
@algotyrnt algotyrnt requested a review from Copilot June 8, 2025 03:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."));
Copy link

Copilot AI Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."));

Copilot uses AI. Check for mistakes.
@algotyrnt algotyrnt merged commit 82fbeda into ShiftSL:main Jun 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants