From cbeb5a5c06a8e9f5b9bd894a2d6eb7aa0ba9cc15 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Thu, 12 Dec 2024 13:59:01 -0800 Subject: [PATCH] fix: don't investigate timeout errors as EF migration issues --- .../Api/Controllers/ApiActionFilter.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs b/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs index d9dc07f5..6cb51ba7 100644 --- a/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs +++ b/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs @@ -13,6 +13,7 @@ using Microsoft.Net.Http.Headers; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Data.Common; using System.Linq; using System.Net; @@ -93,10 +94,11 @@ public virtual void OnActionExecuted(ActionExecutedContext context) currentEx = currentEx.InnerException; } string message = messages.ToString(); - + if ( options.Value.DetailedEfMigrationExceptionMessages && - (context.Exception as DbException ?? context.Exception?.InnerException) is DbException + (context.Exception as DbException ?? context.Exception?.InnerException) is DbException dbEx && + dbEx.InnerException is not Win32Exception { NativeErrorCode: 258 } // The wait operation timed out ) { var dbMessage = GetDbContextMigrationExceptionMessage(context); @@ -199,7 +201,7 @@ private static string GetDbContextMigrationExceptionMessage(ActionExecutedContex if (messages.Count == 0) return ""; - return string.Join(" ", messages) + " This is the likely cause of the following error:"; + return string.Join(" ", messages) + " This is possibly the cause of the following error:"; } public void OnResultExecuting(ResultExecutingContext context)