WinUI: Fehler in der Oberflaeche beenden das Cockpit nicht mehr (Handled, Klick-Abfang, absturz.txt anhaengen)
30.11. 10:10 stuerzte das Cockpit bei einem Klick ab (0x800F1000, Microsoft.UI.Xaml FailFast) und riss den Echtgeld-Laeufer mit (Job KILL_ON_JOB_CLOSE): Tische ohne Kanal, Zuege bis 29 s spaet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -21,7 +21,11 @@ public partial class App : Application
|
||||
_laufend = this;
|
||||
// Ein Absturz hinterlaesst seinen Grund in %APPDATA%\Pokerfreakbsturz.txt (sonst sieht man nur
|
||||
// "Microsoft.UI.Xaml.dll" im Ereignisprotokoll).
|
||||
UnhandledException += (_, e) => Seiten.Merker.Absturz(e.Exception);
|
||||
// 30.11.: Ein Fehler in der Oberflaeche beendet das Cockpit nicht mehr (Handled). Das Cockpit traegt den
|
||||
// Laeufer (Job KILL_ON_JOB_CLOSE): am 30.11. 10:10 riss ein Klick-Fehler (0x800F1000) den Echtgeld-Laeufer mit.
|
||||
UnhandledException += (_, e) => { Seiten.Merker.Absturz(e.Exception, behandelt: true); e.Handled = true; };
|
||||
AppDomain.CurrentDomain.UnhandledException += (_, e) => { if (e.ExceptionObject is Exception x) Seiten.Merker.Absturz(x); };
|
||||
TaskScheduler.UnobservedTaskException += (_, e) => { Seiten.Merker.Absturz(e.Exception, behandelt: true); e.SetObserved(); };
|
||||
}
|
||||
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||
|
||||
@@ -26,14 +26,15 @@ public static class Merker
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Den Grund eines Absturzes neben die Merkdatei schreiben (absturz.txt).</summary>
|
||||
public static void Absturz(Exception e)
|
||||
/// <summary>Den Grund eines Fehlers neben die Merkdatei haengen (absturz.txt; nie ueberschreiben, ab 1 MB als .alt beiseite).</summary>
|
||||
public static void Absturz(Exception e, bool behandelt = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pfad = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Datei)!, "absturz.txt");
|
||||
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(pfad)!);
|
||||
File.WriteAllText(pfad, $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\n{e}\n");
|
||||
if (File.Exists(pfad) && new FileInfo(pfad).Length > 1_000_000) File.Move(pfad, pfad + ".alt", true);
|
||||
File.AppendAllText(pfad, $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}{(behandelt ? " (abgefangen, Cockpit laeuft weiter)" : "")}\n{e}\n\n");
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
+1
-1
@@ -303,7 +303,7 @@ public sealed class Tippflaeche : Grid
|
||||
PointerReleased += (_, _) => { _schleier.Background = _an ? Ui.Weiss(0.05) : null; Scale = new System.Numerics.Vector3(1); };
|
||||
Loaded += (_, _) => CenterPoint = new System.Numerics.Vector3((float)ActualWidth / 2, (float)ActualHeight / 2, 0);
|
||||
SizeChanged += (_, _) => CenterPoint = new System.Numerics.Vector3((float)ActualWidth / 2, (float)ActualHeight / 2, 0);
|
||||
Tapped += (_, e) => { if (_an) { e.Handled = true; Getippt?.Invoke(); } };
|
||||
Tapped += (_, e) => { if (_an) { e.Handled = true; try { Getippt?.Invoke(); } catch (Exception x) { Merker.Absturz(x, behandelt: true); } } };
|
||||
}
|
||||
|
||||
public bool An
|
||||
|
||||
Reference in New Issue
Block a user