Refactor InsertObjectFailedException for more context

InsertObjectFailedException now requires an InsertObjectProcedure
instance, improving error context. Exception throwing in
InsertObjectProcedureHandler updated to pass the procedure object
instead of just a message and serialized request.
This commit is contained in:
2026-01-14 09:44:31 +01:00
parent 2692553865
commit 24f146ca26
2 changed files with 11 additions and 6 deletions

View File

@@ -113,8 +113,6 @@ public class InsertObjectProcedureHandler(IRepository repo) : IRequestHandler<In
else if (long.TryParse(guidParam.Value.ToString(), out var guid))
return guid;
throw new InsertObjectFailedException(
"InsertObject stored procedure did not return a valid identifier." +
JsonSerializer.Serialize(request, options: new() { WriteIndented = true }));
throw new InsertObjectFailedException(request, "InsertObject stored procedure did not return a valid identifier.");
}
}