From f2c1f9a2787de9440da0e9a751515bb0a4c50f10 Mon Sep 17 00:00:00 2001 From: Eddasol Date: Tue, 7 May 2024 12:33:53 +0200 Subject: [PATCH] Fix error message for scheduling in unknown area --- backend/api/Controllers/MissionSchedulingController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/api/Controllers/MissionSchedulingController.cs b/backend/api/Controllers/MissionSchedulingController.cs index a59a34a57..85c62671e 100644 --- a/backend/api/Controllers/MissionSchedulingController.cs +++ b/backend/api/Controllers/MissionSchedulingController.cs @@ -274,7 +274,10 @@ [FromBody] ScheduledMissionQuery scheduledMissionQuery .Select(t => stidService.GetTagArea(t.TagId, scheduledMissionQuery.InstallationCode).Result) .ToList(); } - catch (AreaNotFoundException) { return NotFound("Area not found"); } + catch (Exception e) when (e.InnerException is AreaNotFoundException) + { + return NotFound(e.InnerException.Message); + } Deck? missionDeck = null; foreach (var missionArea in missionAreas)