Skip to content

Commit

Permalink
Correct error message for robotNotAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Apr 26, 2024
1 parent 8c11d95 commit 1c5bf08
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/api/EventHandlers/MissionEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,17 @@ private async void OnMissionRunCreated(object? sender, MissionRunCreatedEventArg
var localizationMissionRun = await LocalizationService.CreateLocalizationMissionInArea(missionRun.Robot.Id, missionRun.Area.Id);
_logger.LogInformation("{Message}", $"Created localization mission run with ID {localizationMissionRun.Id}");
}
catch (RobotNotAvailableException)
{
_logger.LogError("Mission run {MissionRunId} will be aborted as robot {RobotId} was not available", missionRun.Id, missionRun.Robot.Id);
missionRun.Status = MissionStatus.Aborted;
missionRun.StatusReason = "Aborted: Robot was not available";
await MissionService.Update(missionRun);
return;
}
catch (Exception ex) when (
ex is AreaNotFoundException
or DeckNotFoundException
or RobotNotAvailableException
or RobotNotFoundException
or IsarCommunicationException
)
Expand Down

0 comments on commit 1c5bf08

Please sign in to comment.