@@ -12,10 +12,10 @@
-
diff --git a/src/EventLogExpert/Shared/MainLayout.razor.css b/src/EventLogExpert/Shared/MainLayout.razor.css
deleted file mode 100644
index 5acf2da9..00000000
--- a/src/EventLogExpert/Shared/MainLayout.razor.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.display_layout {
- display: flex;
- flex-direction: column;
-
- /* 20px offset for status bar - Adjust later if file menu gets adjusted */
- height: calc(100vh - 20px);
-}
diff --git a/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor
new file mode 100644
index 00000000..08caac91
--- /dev/null
+++ b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor
@@ -0,0 +1,18 @@
+@inherits ErrorBoundary
+
+@if (CurrentException is null)
+{
+ @ChildContent
+}
+else if (ErrorContent is not null)
+{
+ @ErrorContent(CurrentException)
+}
+else
+{
+
+}
diff --git a/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor.cs b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor.cs
new file mode 100644
index 00000000..95862b04
--- /dev/null
+++ b/src/EventLogExpert/Shared/UnhandledExceptionHandler.razor.cs
@@ -0,0 +1,21 @@
+// // Copyright (c) Microsoft Corporation.
+// // Licensed under the MIT License.
+
+using EventLogExpert.Eventing.Helpers;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.Extensions.Logging;
+
+namespace EventLogExpert.Shared;
+
+public partial class UnhandledExceptionHandler : ErrorBoundary
+{
+ [Inject] private ITraceLogger TraceLogger { get; set; } = null!;
+
+ protected override Task OnErrorAsync(Exception exception)
+ {
+ TraceLogger.Trace($"Unhandled exception in UI:\r\n{exception}", LogLevel.Critical);
+
+ return base.OnErrorAsync(exception);
+ }
+}
diff --git a/src/EventLogExpert/wwwroot/css/app.css b/src/EventLogExpert/wwwroot/css/app.css
index 3ceaa328..6d922c10 100644
--- a/src/EventLogExpert/wwwroot/css/app.css
+++ b/src/EventLogExpert/wwwroot/css/app.css
@@ -60,6 +60,7 @@ html, body {
.page {
display: flex;
flex-direction: column;
+ height: 100%;
background-color: var(--background-dark);
color: var(--clr-lightblue);
}
diff --git a/src/EventLogExpert/wwwroot/index.html b/src/EventLogExpert/wwwroot/index.html
index 74db7443..bc3decdb 100644
--- a/src/EventLogExpert/wwwroot/index.html
+++ b/src/EventLogExpert/wwwroot/index.html
@@ -14,7 +14,7 @@
-
Loading...
+
Loading...
An unhandled error has occurred.