mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-06 16:50:07 +01:00
Trace more Sentry errors
This commit is contained in:
parent
b99849675c
commit
8630eb175e
|
|
@ -155,7 +155,7 @@ namespace CommonHelpers
|
|||
{
|
||||
if (!runOnceMutex.WaitOne(runOnceTimeout))
|
||||
{
|
||||
Fatal(title, "Run many times");
|
||||
Fatal(title, "Run many times", false);
|
||||
}
|
||||
}
|
||||
catch (AbandonedMutexException)
|
||||
|
|
@ -249,8 +249,10 @@ namespace CommonHelpers
|
|||
catch { }
|
||||
}
|
||||
|
||||
public static void Fatal(String? title, String message)
|
||||
public static void Fatal(String? title, String message, bool capture = true)
|
||||
{
|
||||
if (capture)
|
||||
Log.TraceError("FATAL: {0}", message);
|
||||
if (title is not null)
|
||||
MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Environment.Exit(1);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,16 @@ namespace CommonHelpers
|
|||
Console.WriteLine(line);
|
||||
}
|
||||
|
||||
public static void TraceError(string format, params object?[] arg)
|
||||
{
|
||||
String line = string.Format(format, arg);
|
||||
Sentry.SentrySdk.CaptureMessage(line, Sentry.SentryLevel.Error);
|
||||
if (LogToTrace)
|
||||
Trace.WriteLine(line);
|
||||
if (LogToConsole)
|
||||
Console.WriteLine(line);
|
||||
}
|
||||
|
||||
public static void TraceException(String type, Object? name, Exception e)
|
||||
{
|
||||
TraceLine("{0}: {1}: Exception: {2}", type, name, e);
|
||||
|
|
|
|||
Loading…
Reference in a new issue