diff --git a/backend/api/EventHandlers/MissionEventHandler.cs b/backend/api/EventHandlers/MissionEventHandler.cs index 26b00259..ecedeabb 100644 --- a/backend/api/EventHandlers/MissionEventHandler.cs +++ b/backend/api/EventHandlers/MissionEventHandler.cs @@ -157,7 +157,7 @@ private async void OnSendRobotToDockTriggered(object? sender, RobotEmergencyEven { await MissionScheduling.ScheduleMissionToDriveToDockPosition(robot.Id); } - catch (DockException ex) + catch (Exception ex) when (ex is DockException || ex is InspectionAreaNotFoundException) { _logger.LogError( ex, diff --git a/backend/api/Services/MissionSchedulingService.cs b/backend/api/Services/MissionSchedulingService.cs index 10384783..217548b8 100644 --- a/backend/api/Services/MissionSchedulingService.cs +++ b/backend/api/Services/MissionSchedulingService.cs @@ -396,7 +396,7 @@ public async Task ScheduleMissionToDriveToDockPosition(string robotId) else { string errorMessage = - $"Robot with ID {robotId} could return home as it did not have an inspection area"; + $"Robot with ID {robotId} could not return home as it did not have an inspection area"; logger.LogError("{Message}", errorMessage); throw new InspectionAreaNotFoundException(errorMessage); }