Skip to content

Commit cd618a9

Browse files
Added a partial error page
1 parent 2630fa1 commit cd618a9

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

GuiStack/Models/ErrorPageModel.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*
6+
* Copyright © Vincent Bengtsson & Contributors 2022-2024
7+
* https://github.com/Visual-Vincent/GuiStack
8+
*/
9+
10+
using System;
11+
12+
namespace GuiStack.Models
13+
{
14+
public class ErrorPageModel
15+
{
16+
public string Title { get; set; }
17+
public string Message { get; set; }
18+
19+
public ErrorPageModel()
20+
{
21+
}
22+
23+
public ErrorPageModel(string message)
24+
{
25+
Message = message;
26+
}
27+
28+
public ErrorPageModel(string title, string message)
29+
{
30+
Title = title;
31+
Message = message;
32+
}
33+
}
34+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*
6+
* Copyright © Vincent Bengtsson & Contributors 2022-2024
7+
* https://github.com/Visual-Vincent/GuiStack
8+
*@
9+
10+
@using GuiStack.Models;
11+
@model ErrorPageModel
12+
13+
<div class="error-container">
14+
<h2 class="error-text">@(!string.IsNullOrWhiteSpace(Model.Title) ? Model.Title : "An error occurred:")</h2>
15+
<p class="error-text">@Model.Message</p>
16+
</div>

0 commit comments

Comments
 (0)