From 3a6ec5ef0c874374cfcc675d980b1ccccc016957 Mon Sep 17 00:00:00 2001 From: Pete Duncanson Date: Thu, 30 Jul 2015 15:36:33 +0100 Subject: [PATCH] Add a log message to stop database start up code from swallowing exception messages, now stash them in the logs to give developers a chance ;) --- src/Umbraco.Core/Persistence/DbConnectionExtensions.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs b/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs index c4ca875eb2..ebbc07ab97 100644 --- a/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs +++ b/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs @@ -7,6 +7,7 @@ using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; +using Umbraco.Core.Logging; namespace Umbraco.Core.Persistence { @@ -75,8 +76,10 @@ namespace Umbraco.Core.Persistence connection.Open(); connection.Close(); } - catch (DbException) + catch (DbException exc) { + // Don't swallow this error, the exception is super handy for knowing "why" its not available + LogHelper.WarnWithException("Configured database is reporting as not being available!", exc ); return false; }