Skip to content

Commit bfa8145

Browse files
committed
Feedback.
1 parent ef94091 commit bfa8145

File tree

5 files changed

+4
-74
lines changed

5 files changed

+4
-74
lines changed

src/Components/Components/src/NavigationManager.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ public virtual void Refresh(bool forceReload = false)
204204
/// <summary>
205205
/// Handles setting the NotFound state.
206206
/// </summary>
207-
protected virtual void NotFoundCore() => throw new NotImplementedException();
207+
protected virtual void NotFoundCore()
208+
{
209+
_notFound?.Invoke(this, new EventArgs());
210+
}
208211

209212
/// <summary>
210213
/// Called to initialize BaseURI and current URI before these values are used for the first time.
@@ -337,21 +340,6 @@ protected void NotifyLocationChanged(bool isInterceptedLink)
337340
}
338341
}
339342

340-
/// <summary>
341-
/// Triggers the <see cref="NotFound"/> event with the current URI value.
342-
/// </summary>
343-
protected void NotifyNotFound()
344-
{
345-
try
346-
{
347-
_notFound?.Invoke(this, new EventArgs());
348-
}
349-
catch (Exception ex)
350-
{
351-
throw new NotFoundRenderingException("An exception occurred while dispatching a NotFound event.", ex);
352-
}
353-
}
354-
355343
/// <summary>
356344
/// Notifies the registered handlers of the current location change.
357345
/// </summary>

src/Components/Components/src/NotFoundRenderingException.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
Microsoft.AspNetCore.Components.IEndpointHtmlRenderer
33
Microsoft.AspNetCore.Components.IEndpointHtmlRenderer.SetNotFoundResponse() -> void
44
Microsoft.AspNetCore.Components.NavigationManager.NotFoundEvent -> System.EventHandler<System.EventArgs!>!
5-
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFound() -> void
6-
Microsoft.AspNetCore.Components.NotFoundRenderingException
7-
Microsoft.AspNetCore.Components.NotFoundRenderingException.NotFoundRenderingException(string! message, System.Exception! innerException) -> void
85
Microsoft.AspNetCore.Components.Routing.IHostEnvironmentNavigationManager.Initialize(string! baseUri, string! uri, Microsoft.AspNetCore.Components.IEndpointHtmlRenderer! renderer) -> void
96
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFound() -> void
107
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFoundCore() -> void

src/Components/Server/src/Circuits/RemoteNavigationManager.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,6 @@ async Task RefreshAsync()
160160
}
161161
}
162162

163-
/// <inheritdoc />
164-
protected override void NotFoundCore()
165-
{
166-
Log.RequestingNotFound(_logger);
167-
168-
try
169-
{
170-
NotifyNotFound();
171-
}
172-
catch (Exception ex)
173-
{
174-
Log.NotFoundRenderFailed(_logger, ex);
175-
UnhandledException?.Invoke(this, ex);
176-
}
177-
}
178-
179163
protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context)
180164
{
181165
Log.NavigationFailed(_logger, context.TargetLocation, ex);
@@ -233,8 +217,5 @@ public static void RequestingNavigation(ILogger logger, string uri, NavigationOp
233217

234218
[LoggerMessage(7, LogLevel.Debug, "Navigation stopped because the session ended when navigating to {Uri}", EventName = "NavigationStoppedSessionEnded")]
235219
public static partial void NavigationStoppedSessionEnded(ILogger logger, string uri);
236-
237-
[LoggerMessage(8, LogLevel.Error, "Failed to render NotFound", EventName = "NotFoundRenderFailed")]
238-
public static partial void NotFoundRenderFailed(ILogger logger, Exception exception);
239220
}
240221
}

src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyNavigationManager.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,6 @@ public override void Refresh(bool forceReload = false)
8585
DefaultWebAssemblyJSRuntime.Instance.InvokeVoid(Interop.Refresh, forceReload);
8686
}
8787

88-
/// <inheritdoc />
89-
protected override void NotFoundCore()
90-
{
91-
try
92-
{
93-
NotifyNotFound();
94-
}
95-
catch (Exception ex)
96-
{
97-
Log.NotFoundRenderFailed(_logger, ex);
98-
}
99-
}
100-
10188
protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context)
10289
{
10390
Log.NavigationFailed(_logger, context.TargetLocation, ex);
@@ -113,8 +100,5 @@ private static partial class Log
113100

114101
[LoggerMessage(2, LogLevel.Error, "Navigation failed when changing the location to {Uri}", EventName = "NavigationFailed")]
115102
public static partial void NavigationFailed(ILogger logger, string uri, Exception exception);
116-
117-
[LoggerMessage(3, LogLevel.Error, "Failed to render NotFound", EventName = "NotFoundRenderFailed")]
118-
public static partial void NotFoundRenderFailed(ILogger logger, Exception exception);
119103
}
120104
}

0 commit comments

Comments
 (0)