From 0aa2ab9dc70b05e847e2d5859f3ba5cb8054be43 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Fri, 6 Oct 2023 04:05:25 +0200 Subject: [PATCH] fix: send 400, don't throw. --- Shoko.Server/API/v3/Models/Shoko/Group.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shoko.Server/API/v3/Models/Shoko/Group.cs b/Shoko.Server/API/v3/Models/Shoko/Group.cs index 48220f586..05443eda0 100644 --- a/Shoko.Server/API/v3/Models/Shoko/Group.cs +++ b/Shoko.Server/API/v3/Models/Shoko/Group.cs @@ -274,7 +274,7 @@ public CreateOrUpdateGroupBody(SVR_AnimeGroup group) var unknownSeriesIDs = SeriesIDs .Where(id => !seriesList.Any(series => series.AnimeSeriesID == id)) .ToList(); - throw new Exception($"Unable to get series with ids \"{string.Join("\", \"", unknownSeriesIDs)}\"."); + modelState.AddModelError(nameof(SeriesIDs), $"Unable to get series with ids \"{string.Join("\", \"", unknownSeriesIDs)}\"."); } // Get a list of all the series across the new inputs and the existing group.