From e9526106ff80937040373512ffe1b2544eec4279 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 18 Feb 2015 23:22:49 +0100 Subject: [PATCH] Improved logging on DbUpgrade --- Logic/Support/DatabaseMaintenance.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Logic/Support/DatabaseMaintenance.cs b/Logic/Support/DatabaseMaintenance.cs index dc884efc..cc360532 100644 --- a/Logic/Support/DatabaseMaintenance.cs +++ b/Logic/Support/DatabaseMaintenance.cs @@ -83,12 +83,14 @@ namespace Swarmops.Logic.Support { try { - SwarmDb.GetDatabaseForAdmin().ExecuteAdminCommand (sqlCommand.Trim()); + SwarmDb.GetDatabaseForAdmin().ExecuteAdminCommand (sqlCommand.Trim().TrimEnd (';')); // removes whitespace first, then any ; at the end (if left in by mistake) } catch (MySqlException exception) { SwarmDb.GetDatabaseForWriting() - .CreateExceptionLogEntry (DateTime.UtcNow, "DatabaseUpgrade", exception); + .CreateExceptionLogEntry (DateTime.UtcNow, "DatabaseUpgrade", + new Exception (string.Format ("Exception upgrading to Db{0:D4}", currentDbVersion), + exception)); // Continue processing after logging error. // TODO: Throw and abort? Tricky decision