Skip to content

Commit

Permalink
Update exception thrown for bad input
Browse files Browse the repository at this point in the history
  • Loading branch information
RossClark01 committed Dec 12, 2024
1 parent adbdac9 commit 09111e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions Gordon360/Documentation/Gordon360.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Gordon360/Services/HousingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Gordon360.Static.Methods;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using Gordon360.Static.Names;

namespace Gordon360.Services;

Expand Down Expand Up @@ -547,7 +548,7 @@ public async Task<Hall_Assignment_Ranges> CreateRoomRangeAsync(HallAssignmentRan
// Check if Room_End is greater than Room_Start
if (model.Room_End <= model.Room_Start)
{
throw new ArgumentException("Room_End must be greater than Room_Start.");
throw new BadInputException() { ExceptionMessage = "Room_End must be greater than Room_Start." };
}
// Check if there is any overlapping room ranges in the same hall
var overlappingRange = await context.Hall_Assignment_Ranges
Expand Down

0 comments on commit 09111e7

Please sign in to comment.