diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2021-02-09 22:55:40 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2021-02-09 22:55:40 -0500 |
| commit | aefa631ff3f648060f5c0fe5d51aee89e3898a85 (patch) | |
| tree | 927ffb8f19de6190b20a0180e162e2c8b7f3469e /Erable/Program.cs | |
| parent | e81e3817c0a4b735da47e6c45529c6f88ed4d52f (diff) | |
| download | erable-godot-aefa631ff3f648060f5c0fe5d51aee89e3898a85.tar.gz erable-godot-aefa631ff3f648060f5c0fe5d51aee89e3898a85.tar.bz2 erable-godot-aefa631ff3f648060f5c0fe5d51aee89e3898a85.zip | |
Discord RPC; About window
Diffstat (limited to 'Erable/Program.cs')
| -rw-r--r-- | Erable/Program.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/Erable/Program.cs b/Erable/Program.cs index f461a79..9999bee 100644 --- a/Erable/Program.cs +++ b/Erable/Program.cs @@ -1,6 +1,5 @@ using System;
using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.ReactiveUI;
namespace Erable
@@ -13,13 +12,29 @@ namespace Erable public static void Main(string[] args)
{
Console.WriteLine("Erable: Audio Player by Alee Productions");
- Console.WriteLine("Running on .NET " + Environment.Version + ", and " + Environment.OSVersion);
+
+ AppDomain.CurrentDomain.UnhandledException += ErrorHandler;
+
#if DEBUG
- Console.WriteLine("Opening MainWindow...");
+ Console.WriteLine("Running on .NET " + Environment.Version + ", and " + Environment.OSVersion);
+ Console.WriteLine("Opening window...");
#endif
- try { BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); }catch (Exception ex) { Console.WriteLine(ex); }
- }
+
+ DiscordRpc.Initialize();
+
+ BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
+
+ }
+ static void ErrorHandler(object sender, UnhandledExceptionEventArgs e)
+ {
+ Console.WriteLine("Oh no! An error has occurred!");
+ Console.WriteLine("OS Version: " + Environment.OSVersion);
+ Console.WriteLine(".NET Version: " + Environment.Version);
+ Console.WriteLine("Report this to the developers...");
+ Console.WriteLine("Did this crashed? " + e.IsTerminating);
+ }
+
// Avalonia configuration, don't remove; also used by visual designer.
static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
|
