refactor(UserRepController): remove try-catch block

This commit is contained in:
Developer 02 2025-08-05 19:50:43 +02:00
parent 5f41e1b604
commit 278090ea85

View File

@ -23,8 +23,6 @@ public class UserRepController : BaseAuthController<IUserRepService, UserRepCrea
[HttpGet] [HttpGet]
public async Task<IActionResult> GetAll(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null) public async Task<IActionResult> 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, return await _service.ReadAllAsync(withUser: withUser, withRepGroup: withRepGroup, withGroup: withGroup, withRepUser: withRepUser,
userId: userId, groupId: groupId).ThenAsync(Ok, IActionResult (m, n) => userId: userId, groupId: groupId).ThenAsync(Ok, IActionResult (m, n) =>
@ -33,10 +31,4 @@ public class UserRepController : BaseAuthController<IUserRepService, UserRepCrea
return NotFound(); return NotFound();
}); });
} }
catch (Exception ex)
{
_logger.LogError(ex, "{Message}", ex.Message);
return StatusCode(StatusCodes.Status500InternalServerError);
}
}
} }