Skip to content

Commit

Permalink
Feature: Return 500 on Failed MQTT Message (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
willsawyerrrr authored Oct 14, 2024
2 parents 079f7b7 + 33c60e5 commit c4f3a44
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Mortein/Controllers/CommandController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,18 @@ private static string ConstructTopicName(Guid deviceId)
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult ToggleDeviceVibration(Guid deviceId)
{
PublishCommand(deviceId, new ToggleVibrationCommand()
try
{
DeviceId = deviceId,
});
return NoContent();
PublishCommand(deviceId, new ToggleVibrationCommand()
{
DeviceId = deviceId,
});
return NoContent();
}
catch
{
return Problem();
}
}

/// <summary>
Expand Down

0 comments on commit c4f3a44

Please sign in to comment.