From 712ad189c99570f686ab779782b2a873e172428e Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Tue, 13 Jun 2023 20:25:05 +0200 Subject: Change syntax style --- MatrixRoomUtils.Web.Server/Pages/Error.cshtml | 49 ++++++++++++------------ MatrixRoomUtils.Web.Server/Pages/Error.cshtml.cs | 21 ++++------ 2 files changed, 31 insertions(+), 39 deletions(-) (limited to 'MatrixRoomUtils.Web.Server/Pages') diff --git a/MatrixRoomUtils.Web.Server/Pages/Error.cshtml b/MatrixRoomUtils.Web.Server/Pages/Error.cshtml index 0125c85..04b2c2a 100644 --- a/MatrixRoomUtils.Web.Server/Pages/Error.cshtml +++ b/MatrixRoomUtils.Web.Server/Pages/Error.cshtml @@ -5,38 +5,37 @@ - - + + Error - - + + -
-
-

Error.

-

An error occurred while processing your request.

+
+
+

Error.

+

An error occurred while processing your request.

- @if (Model.ShowRequestId) - { -

- Request ID: @Model.RequestId -

- } - -

Development Mode

-

- Swapping to the Development environment displays detailed information about the error that occurred. -

+ @if (Model.ShowRequestId) {

- The Development environment shouldn't be enabled for deployed applications. - It can result in displaying sensitive information from exceptions to end users. - For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development - and restarting the app. + Request ID: @Model.RequestId

-
+ } + +

Development Mode

+

+ Swapping to the Development environment displays detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

+
- + \ No newline at end of file diff --git a/MatrixRoomUtils.Web.Server/Pages/Error.cshtml.cs b/MatrixRoomUtils.Web.Server/Pages/Error.cshtml.cs index b70d895..4b918c1 100644 --- a/MatrixRoomUtils.Web.Server/Pages/Error.cshtml.cs +++ b/MatrixRoomUtils.Web.Server/Pages/Error.cshtml.cs @@ -6,21 +6,14 @@ namespace MatrixRoomUtils.Web.Server.Pages; [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] [IgnoreAntiforgeryToken] -public class ErrorModel : PageModel -{ - public string? RequestId { get; set; } +public class ErrorModel : PageModel { + private readonly ILogger _logger; - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + public ErrorModel(ILogger logger) => _logger = logger; - private readonly ILogger _logger; + public string? RequestId { get; set; } - public ErrorModel(ILogger logger) - { - _logger = logger; - } + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - public void OnGet() - { - RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; - } -} + public void OnGet() => RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; +} \ No newline at end of file -- cgit 1.5.1