From f290a395abbcbdee135ee611fc3c2d8851cbccee Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Thu, 30 Jul 2026 08:48:37 +0100 Subject: [PATCH] Return early on sync failure, log warning instead Replaced ApplicationStartupException with early return when syncResult.IsFailed is true. Now logs a warning and exits the method gracefully if file profile retrieval fails, improving error handling without terminating the application. --- FileProcessor/Common/Extensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FileProcessor/Common/Extensions.cs b/FileProcessor/Common/Extensions.cs index 6fee4d2..401596c 100644 --- a/FileProcessor/Common/Extensions.cs +++ b/FileProcessor/Common/Extensions.cs @@ -79,7 +79,7 @@ public static void PreWarm(this IApplicationBuilder applicationBuilder){ if (syncResult.IsFailed) { Logger.LogWarning($"Error getting file profiles {syncResult.Message}"); - throw new ApplicationStartupException(syncResult.Message); + return; } Result recoveryResult = recoveryService.RecoverInProgressFilesAsync(CancellationToken.None).GetAwaiter().GetResult();