diff --git a/source/gpconnect-appointment-checker/Models/SearchModel.cs b/source/gpconnect-appointment-checker/Models/SearchModel.cs
index 072cbadb..b593b43c 100644
--- a/source/gpconnect-appointment-checker/Models/SearchModel.cs
+++ b/source/gpconnect-appointment-checker/Models/SearchModel.cs
@@ -44,5 +44,6 @@ 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 8adac509..0aa1ecf0 100644
--- a/source/gpconnect-appointment-checker/Pages/Private/CodeError.cshtml
+++ b/source/gpconnect-appointment-checker/Pages/Private/CodeError.cshtml
@@ -78,4 +78,15 @@ 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 e2f9b995..d71b33bd 100644
--- a/source/gpconnect-appointment-checker/Pages/Private/Search.cshtml.cs
+++ b/source/gpconnect-appointment-checker/Pages/Private/Search.cshtml.cs
@@ -140,6 +140,11 @@ 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
deleted file mode 100644
index 83265386..00000000
--- a/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml
+++ /dev/null
@@ -1,26 +0,0 @@
-@page
-@using gpconnect_appointment_checker.Helpers.Constants
-@model gpconnect_appointment_checker.Pages.ErrorModel
-@addTagHelper *, gpconnect-appointment-checker
-
-
-
-
-
@SearchConstants.ISSUEWITHTIMEOUTTITLETEXT
-
-
- Error: @SearchConstants.ISSUEWITHTIMEOUTTEXT
-
-
-
-
-
-
\ 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
deleted file mode 100644
index 6e40d582..00000000
--- a/source/gpconnect-appointment-checker/Pages/Public/TimeoutError.cshtml.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-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);
- }
- }
-}