From 0f8786143f9ae173678bbf942946df788c7c86ae Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 8 Mar 2020 10:55:33 +0100 Subject: [PATCH] Ignore database shutting down errors --- PluralKit.Bot/Utils/MiscUtils.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PluralKit.Bot/Utils/MiscUtils.cs b/PluralKit.Bot/Utils/MiscUtils.cs index 68cbe613..238c1711 100644 --- a/PluralKit.Bot/Utils/MiscUtils.cs +++ b/PluralKit.Bot/Utils/MiscUtils.cs @@ -5,6 +5,8 @@ using System.Threading.Tasks; using Discord.Net; +using Npgsql; + using PluralKit.Core; namespace PluralKit.Bot @@ -32,6 +34,9 @@ namespace PluralKit.Bot // Sometimes Discord just times everything out. if (e is TimeoutException) return false; + // Ignore "Database is shutting down" error + if (e is PostgresException pe && pe.SqlState == "57P03") return false; + // This may expanded at some point. return true; }