aboutsummaryrefslogtreecommitdiffstats
path: root/src/Pages/Errors/Index.cshtml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Pages/Errors/Index.cshtml.cs')
-rw-r--r--src/Pages/Errors/Index.cshtml.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Pages/Errors/Index.cshtml.cs b/src/Pages/Errors/Index.cshtml.cs
new file mode 100644
index 0000000..05e405d
--- /dev/null
+++ b/src/Pages/Errors/Index.cshtml.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Net;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace VSH.Pages.Errors;
+
+public class Index : PageModel
+{
+ public HttpStatusCode ErrorStatusCode { get; set; }
+
+ public void OnGet() {
+ try {
+ if (int.TryParse(RouteData.Values["code"]?.ToString(), out var status))
+ ErrorStatusCode = (HttpStatusCode)status;
+ } catch (Exception e) {
+ Console.WriteLine(e);
+ }
+ }
+} \ No newline at end of file