Skip to content

Commit

Permalink
Feature: Return 500 on Failed MQTT Message (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
willsawyerrrr authored Oct 15, 2024
2 parents c4f3a44 + a7e35cc commit e90e786
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Mortein/Controllers/CommandController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,18 @@ public IActionResult ToggleDeviceVibration(Guid deviceId)
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult VibrateDeviceForDuration(Guid deviceId, int seconds)
{
PublishCommand(deviceId, new VibrateForDurationCommand()
try
{
PublishCommand(deviceId, new VibrateForDurationCommand()
{
DeviceId = deviceId,
Seconds = seconds,
});
return NoContent();
}
catch
{
DeviceId = deviceId,
Seconds = seconds,
});
return NoContent();
return Problem();
}
}
}

0 comments on commit e90e786

Please sign in to comment.