diff --git a/LCU.API.Operations.IncentiveAPI/LCU.API.Internal.Operations.IncentiveApi/Services/SafeQueueReturnResponse.cs b/LCU.API.Operations.IncentiveAPI/LCU.API.Internal.Operations.IncentiveApi/Services/SafeQueueReturnResponse.cs new file mode 100644 index 0000000..3ad067f --- /dev/null +++ b/LCU.API.Operations.IncentiveAPI/LCU.API.Internal.Operations.IncentiveApi/Services/SafeQueueReturnResponse.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using LCU.Library.Internal.ApiResponse.Services; + +namespace LCU.API.Internal.Operations.IncentiveApi.Services; + +public static class SafeQueueReturnResponse +{ + public static async Task TryQueueResponse(TRequest request, bool success, List messageStack, string context) + { + try + { + await QueueReturnResponse.QueueResponse(request, success, messageStack ?? new List()); + } + catch (Exception exception) + { + Log.Error(exception, "Failed to queue return response for {Context}.", context); + } + } +}