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:
@@ -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.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user