From c0189016e8edb5218d1e82cc85ed59f1e2c55953 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sun, 25 Jan 2026 16:32:54 +0100 Subject: [PATCH] Improved logging in EntityController --- src/Server/Controllers/EntityController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Server/Controllers/EntityController.cs b/src/Server/Controllers/EntityController.cs index b1a9406..9fbfc53 100644 --- a/src/Server/Controllers/EntityController.cs +++ b/src/Server/Controllers/EntityController.cs @@ -116,12 +116,14 @@ public class EntityController : ControllerBase else { _logger.LogError("Unable to deserialize an entity"); + ElmahCore.ElmahExtensions.RaiseError(new Exception("Unable to deserialize an entity")); return Ok(new EntityIndexResult() { Success = false, Message = "Unable to deserialize an entity"}); } } catch (Exception ex) { if (ex.InnerException is not null) ex = ex.InnerException; _logger.LogError("Unable to index the provided entities. {ex.Message} - {ex.StackTrace}", [ex.Message, ex.StackTrace]); + ElmahCore.ElmahExtensions.RaiseError(ex); return Ok(new EntityIndexResult() { Success = false, Message = ex.Message }); } @@ -142,6 +144,11 @@ public class EntityController : ControllerBase if (entity_ is null) { _logger.LogError("Unable to delete the entity {entityName} in {searchdomain} - it was not found under the specified name", [entityName, searchdomain]); + ElmahCore.ElmahExtensions.RaiseError( + new Exception( + $"Unable to delete the entity {entityName} in {searchdomain} - it was not found under the specified name" + ) + ); return Ok(new EntityDeleteResults() {Success = false, Message = "Entity not found"}); } searchdomain_.ReconciliateOrInvalidateCacheForDeletedEntity(entity_);