Skip to content

Commit

Permalink
Better handle Rakaly error when there is not enough space on the disk (
Browse files Browse the repository at this point in the history
…#1755) #patch
  • Loading branch information
IhateTrains authored Feb 10, 2024
1 parent a90f74e commit 27e12db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ImperatorToCK3/Helpers/RakalyCaller.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using commonItems;
using ImperatorToCK3.Exceptions;
using System;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -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.";
}
Expand Down

0 comments on commit 27e12db

Please sign in to comment.