summaryrefslogtreecommitdiff
path: root/dwalker.xyz/Pages/Error.cshtml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'dwalker.xyz/Pages/Error.cshtml.cs')
-rw-r--r--dwalker.xyz/Pages/Error.cshtml.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/dwalker.xyz/Pages/Error.cshtml.cs b/dwalker.xyz/Pages/Error.cshtml.cs
new file mode 100644
index 0000000..b7e3274
--- /dev/null
+++ b/dwalker.xyz/Pages/Error.cshtml.cs
@@ -0,0 +1,20 @@
+using System.Diagnostics;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace dwalker.xyz.Pages;
+
+[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+[IgnoreAntiforgeryToken]
+public class ErrorModel : PageModel
+{
+ public string? RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ public void OnGet()
+ {
+ RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
+ }
+}
+