Skip to content

Commit e2722b6

Browse files
committed
Prevent backend from crashing if no inspectionArea
1 parent 0bd04e2 commit e2722b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backend/api/EventHandlers/MissionEventHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private async void OnSendRobotToDockTriggered(object? sender, RobotEmergencyEven
157157
{
158158
await MissionScheduling.ScheduleMissionToDriveToDockPosition(robot.Id);
159159
}
160-
catch (DockException ex)
160+
catch (Exception ex) when (ex is DockException || ex is InspectionAreaNotFoundException)
161161
{
162162
_logger.LogError(
163163
ex,

backend/api/Services/MissionSchedulingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public async Task ScheduleMissionToDriveToDockPosition(string robotId)
395395
else
396396
{
397397
string errorMessage =
398-
$"Robot with ID {robotId} could return home as it did not have an inspection area";
398+
$"Robot with ID {robotId} could not return home as it did not have an inspection area";
399399
logger.LogError("{Message}", errorMessage);
400400
throw new InspectionAreaNotFoundException(errorMessage);
401401
}

0 commit comments

Comments
 (0)