diff --git a/source/gpconnect-appointment-checker/Models/SearchModel.cs b/source/gpconnect-appointment-checker/Models/SearchModel.cs index b593b43c..072cbadb 100644 --- a/source/gpconnect-appointment-checker/Models/SearchModel.cs +++ b/source/gpconnect-appointment-checker/Models/SearchModel.cs @@ -44,6 +44,5 @@ public partial class SearchModel public string ProviderErrorDiagnostics { get; set; } public int? SearchResultsCount { get; set; } public bool LdapErrorRaised { get; set; } - public bool TimeoutErrorRaised { get; set; } } } diff --git a/source/gpconnect-appointment-checker/Pages/Private/CodeError.cshtml b/source/gpconnect-appointment-checker/Pages/Private/CodeError.cshtml index 0aa1ecf0..8adac509 100644 --- a/source/gpconnect-appointment-checker/Pages/Private/CodeError.cshtml +++ b/source/gpconnect-appointment-checker/Pages/Private/CodeError.cshtml @@ -78,15 +78,4 @@ else if (Model.LdapErrorRaised) -} -else if (Model.TimeoutErrorRaised) -{ -
-
-
-

@SearchConstants.ISSUEWITHTIMEOUTTITLETEXT

-

@SearchConstants.ISSUEWITHTIMEOUTTEXT

-
-
-
} \ No newline at end of file diff --git a/source/gpconnect-appointment-checker/Pages/Private/Search.cshtml.cs b/source/gpconnect-appointment-checker/Pages/Private/Search.cshtml.cs index d71b33bd..e2f9b995 100644 --- a/source/gpconnect-appointment-checker/Pages/Private/Search.cshtml.cs +++ b/source/gpconnect-appointment-checker/Pages/Private/Search.cshtml.cs @@ -140,11 +140,6 @@ private async Task GetSearchResults() LdapErrorRaised = true; _auditSearchIssues.Add(SearchConstants.ISSUEWITHLDAPTEXT); } - catch (TimeoutException) - { - TimeoutErrorRaised = true; - _auditSearchIssues.Add(SearchConstants.ISSUEWITHTIMEOUTTEXT); - } } private async Task PopulateSearchResults(Spine providerGpConnectDetails, Organisation providerOrganisationDetails, diff --git a/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml b/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml new file mode 100644 index 00000000..83265386 --- /dev/null +++ b/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml @@ -0,0 +1,26 @@ +@page +@using gpconnect_appointment_checker.Helpers.Constants +@model gpconnect_appointment_checker.Pages.ErrorModel +@addTagHelper *, gpconnect-appointment-checker + +
+
+ + +
+
\ No newline at end of file diff --git a/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml.cs b/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml.cs new file mode 100644 index 00000000..6e40d582 --- /dev/null +++ b/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml.cs @@ -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 _logger; + + public TimeoutErrorModel(IConfiguration configuration, IHttpContextAccessor contextAccessor, ILogger 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(); + _logger.LogError($"Timeout error thrown at {exceptionHandlerPathFeature?.Path} - ", exceptionHandlerPathFeature?.Error.InnerException); + } + } +}