-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "#117 Implementation of graceful timeout exception"
This reverts commit 4fb00e6.
- Loading branch information
Jonny Rylands
committed
Jan 28, 2021
1 parent
4fb00e6
commit 20931c7
Showing
5 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@page | ||
@using gpconnect_appointment_checker.Helpers.Constants | ||
@model gpconnect_appointment_checker.Pages.ErrorModel | ||
@addTagHelper *, gpconnect-appointment-checker | ||
|
||
<div class="nhsuk-grid-row"> | ||
<div class="nhsuk-grid-column-two-thirds"> | ||
<div class="nhsuk-error-summary" aria-labelledby="error-summary-title" role="alert" tabindex="-1"> | ||
<h2 class="nhsuk-error-summary__title" id="error-summary-title">@SearchConstants.ISSUEWITHTIMEOUTTITLETEXT</h2> | ||
<div class="nhsuk-error-summary__body"> | ||
<span class="nhsuk-error-message"> | ||
<span class="nhsuk-u-visually-hidden">Error:</span> @SearchConstants.ISSUEWITHTIMEOUTTEXT | ||
</span> | ||
</div> | ||
</div> | ||
<div class="nhsuk-action-link"> | ||
<a class="nhsuk-action-link__link" href="/Search"> | ||
<svg class="nhsuk-icon nhsuk-icon__arrow-right-circle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"> | ||
<path d="M0 0h24v24H0z" fill="none"></path> | ||
<path d="M12 2a10 10 0 0 0-9.95 9h11.64L9.74 7.05a1 1 0 0 1 1.41-1.41l5.66 5.65a1 1 0 0 1 0 1.42l-5.66 5.65a1 1 0 0 1-1.41 0 1 1 0 0 1 0-1.41L13.69 13H2.05A10 10 0 1 0 12 2z"></path> | ||
</svg> | ||
<span class="nhsuk-action-link__text">@SearchConstants.RETURNTOSEARCHPAGETEXT</span> | ||
</a> | ||
</div> | ||
</div> | ||
</div> |
33 changes: 33 additions & 0 deletions
33
source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using gpconnect_appointment_checker.SDS.Interfaces; | ||
using Microsoft.AspNetCore.Diagnostics; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Logging; | ||
using System.Diagnostics; | ||
|
||
namespace gpconnect_appointment_checker.Pages | ||
{ | ||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | ||
public class TimeoutErrorModel : PageModel | ||
{ | ||
protected ILogger<TimeoutErrorModel> _logger; | ||
|
||
public TimeoutErrorModel(IConfiguration configuration, IHttpContextAccessor contextAccessor, ILogger<TimeoutErrorModel> logger, ILdapService ldapService) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public string RequestId { get; set; } | ||
public string ExceptionMessage { get; set; } | ||
|
||
public void OnGet() | ||
{ | ||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; | ||
var exceptionHandlerPathFeature = | ||
HttpContext.Features.Get<IExceptionHandlerPathFeature>(); | ||
_logger.LogError($"Timeout error thrown at {exceptionHandlerPathFeature?.Path} - ", exceptionHandlerPathFeature?.Error.InnerException); | ||
} | ||
} | ||
} |