Remove error handlers, to be implemented at a global level in a separate PR

This commit is contained in:
ZadenRB 2020-04-20 20:16:58 -06:00
parent 688240151b
commit 67efcbee05
1 changed files with 12 additions and 35 deletions

View File

@ -73,16 +73,9 @@ namespace Jellyfin.Api.Controllers
[HttpGet("Types")] [HttpGet("Types")]
[ProducesResponseType(typeof(IEnumerable<NameIdPair>), StatusCodes.Status200OK)] [ProducesResponseType(typeof(IEnumerable<NameIdPair>), StatusCodes.Status200OK)]
public IActionResult GetNotificationTypes() public IActionResult GetNotificationTypes()
{
try
{ {
return Ok(_notificationManager.GetNotificationTypes()); return Ok(_notificationManager.GetNotificationTypes());
} }
catch (Exception e)
{
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
}
}
/// <summary> /// <summary>
/// Endpoint for getting notification services. /// Endpoint for getting notification services.
@ -91,16 +84,9 @@ namespace Jellyfin.Api.Controllers
[HttpGet("Services")] [HttpGet("Services")]
[ProducesResponseType(typeof(IEnumerable<NameIdPair>), StatusCodes.Status200OK)] [ProducesResponseType(typeof(IEnumerable<NameIdPair>), StatusCodes.Status200OK)]
public IActionResult GetNotificationServices() public IActionResult GetNotificationServices()
{
try
{ {
return Ok(_notificationManager.GetNotificationServices()); return Ok(_notificationManager.GetNotificationServices());
} }
catch (Exception e)
{
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
}
}
/// <summary> /// <summary>
/// Endpoint to send a notification to all admins. /// Endpoint to send a notification to all admins.
@ -112,13 +98,11 @@ namespace Jellyfin.Api.Controllers
/// <returns>Status.</returns> /// <returns>Status.</returns>
[HttpPost("Admin")] [HttpPost("Admin")]
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
public IActionResult CreateAdminNotification( public void CreateAdminNotification(
[FromQuery] string name, [FromQuery] string name,
[FromQuery] string description, [FromQuery] string description,
[FromQuery] string? url, [FromQuery] string? url,
[FromQuery] NotificationLevel? level) [FromQuery] NotificationLevel? level)
{
try
{ {
var notification = new NotificationRequest var notification = new NotificationRequest
{ {
@ -131,13 +115,6 @@ namespace Jellyfin.Api.Controllers
}; };
_notificationManager.SendNotification(notification, CancellationToken.None); _notificationManager.SendNotification(notification, CancellationToken.None);
return Ok();
}
catch (Exception e)
{
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
}
} }
/// <summary> /// <summary>