Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DisplayException()

static void Terraria.Program.DisplayException ( Exception e)
inlinestaticprivate

Definition at line 247 of file Program.cs.

248 {
249 try
250 {
251 string text = e.ToString();
252 if (WorldGen.gen)
253 {
254 try
255 {
256 text = $"Creating world - Seed: {Main.ActiveWorldFileData.Seed} Width: {Main.maxTilesX}, Height: {Main.maxTilesY}, Evil: {WorldGen.WorldGenParam_Evil}, IsExpert: {Main.expertMode}\n{text}";
257 }
258 catch
259 {
260 }
261 }
262 using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", append: true))
263 {
264 streamWriter.WriteLine(DateTime.Now);
265 streamWriter.WriteLine(text);
266 streamWriter.WriteLine("");
267 }
268 if (Main.dedServ)
269 {
270 Console.WriteLine(Language.GetTextValue("Error.ServerCrash"), DateTime.Now, text);
271 }
272 MessageBox.Show(text, "Terraria: Error");
273 }
274 catch
275 {
276 }
277 }
static void WriteLine()
Definition Console.cs:733
override string ToString()
Definition Exception.cs:384
static string GetTextValue(string key)
Definition Language.cs:15
static DateTime Now
Definition DateTime.cs:103

References Terraria.Main.dedServ, Terraria.WorldGen.gen, Terraria.Localization.Language.GetTextValue(), System.DateTime.Now, System.text, System.Exception.ToString(), and System.Console.WriteLine().

Referenced by Terraria.Program.RunGame().