From 27e12dbf9f2c2f1d6126c8f9578e45f675f0d470 Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Sat, 10 Feb 2024 16:00:35 +0100 Subject: [PATCH] Better handle Rakaly error when there is not enough space on the disk (#1755) #patch --- ImperatorToCK3/Helpers/RakalyCaller.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ImperatorToCK3/Helpers/RakalyCaller.cs b/ImperatorToCK3/Helpers/RakalyCaller.cs index e14114a60..ce4ea9b66 100644 --- a/ImperatorToCK3/Helpers/RakalyCaller.cs +++ b/ImperatorToCK3/Helpers/RakalyCaller.cs @@ -1,4 +1,5 @@ using commonItems; +using ImperatorToCK3.Exceptions; using System; using System.Diagnostics; using System.IO; @@ -67,8 +68,12 @@ public static void MeltSave(string savePath) { Logger.Debug($"Rakaly exit code: {returnCode}"); string stdErrText = process.StandardError.ReadToEnd(); Logger.Debug($"Rakaly standard error: {stdErrText}"); - + string exceptionMessage = "Rakaly melter failed to melt the save."; + if (stdErrText.Contains("There is not enough space on the disk.")) { + throw new UserErrorException($"{exceptionMessage} There is not enough space on the disk."); + } + if (stdErrText.Contains("memory allocation of")) { exceptionMessage += " One possible reason is that you don't have enough RAM."; }