output more error data

This commit is contained in:
Adam R. Grey 2021-12-04 03:02:38 -05:00
parent 76fe65c08c
commit 114813400e

View File

@ -5,6 +5,7 @@ using System.Diagnostics;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
namespace silverworker_discord
{
@ -59,7 +60,13 @@ namespace silverworker_discord
errorFilename = $"{dumpDir}/error{i}.err";
}
File.WriteAllText(outputFilename, outputData.ToString());
File.WriteAllText(errorFilename, errorFilename.ToString());
using(var sw =new StreamWriter(new FileStream(errorFilename, FileMode.Append, FileAccess.Write)))
{
sw.WriteLine("== my own error ==");
sw.WriteLine(JsonConvert.SerializeObject(e));
sw.WriteLine("== error log ==");
sw.WriteLine(errorData.ToString());
}
return false;
}
return true;