From f7c333b67192b7967a0d7780e85d7469de73dfec Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 15 Jun 2022 07:48:57 +0200 Subject: [PATCH] Ignoring error if creds_example.yml fails to generate, as this happens in docker containers --- src/NadekoBot/Services/Impl/BotCredsProvider.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Services/Impl/BotCredsProvider.cs b/src/NadekoBot/Services/Impl/BotCredsProvider.cs index 4550e60f9..e1a791e5d 100644 --- a/src/NadekoBot/Services/Impl/BotCredsProvider.cs +++ b/src/NadekoBot/Services/Impl/BotCredsProvider.cs @@ -37,8 +37,15 @@ public sealed class BotCredsProvider : IBotCredsProvider public BotCredsProvider(int? totalShards = null) { _totalShards = totalShards; - if (!File.Exists(CredsExamplePath)) - File.WriteAllText(CredsExamplePath, Yaml.Serializer.Serialize(_creds)); + try + { + if (!File.Exists(CredsExamplePath)) + File.WriteAllText(CredsExamplePath, Yaml.Serializer.Serialize(_creds)); + } + catch + { + // this can fail in docker containers + } MigrateCredentials();