From 278090ea85eaed2c71b7c0ba2e4e95525af57c43 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 5 Aug 2025 19:50:43 +0200 Subject: [PATCH] refactor(UserRepController): remove try-catch block --- .../Controllers/UserRepController.cs | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/DigitalData.UserManager.API/Controllers/UserRepController.cs b/src/DigitalData.UserManager.API/Controllers/UserRepController.cs index b9eb082..1d46fd2 100644 --- a/src/DigitalData.UserManager.API/Controllers/UserRepController.cs +++ b/src/DigitalData.UserManager.API/Controllers/UserRepController.cs @@ -20,23 +20,15 @@ public class UserRepController : BaseAuthController GetAll(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null) { - try - { - return await _service.ReadAllAsync(withUser: withUser, withRepGroup: withRepGroup, withGroup: withGroup, withRepUser: withRepUser, - userId: userId, groupId: groupId).ThenAsync(Ok, IActionResult (m, n) => - { - _logger.LogNotice(n); - return NotFound(); - }); - } - catch (Exception ex) + return await _service.ReadAllAsync(withUser: withUser, withRepGroup: withRepGroup, withGroup: withGroup, withRepUser: withRepUser, + userId: userId, groupId: groupId).ThenAsync(Ok, IActionResult (m, n) => { - _logger.LogError(ex, "{Message}", ex.Message); - return StatusCode(StatusCodes.Status500InternalServerError); - } + _logger.LogNotice(n); + return NotFound(); + }); } } \ No newline at end of file