Skip to content

Commit 8553ccf

Browse files
committed
@campersau's feedback: unify the catching approach.
1 parent 7194848 commit 8553ccf

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Prerendering.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,22 +235,9 @@ async Task Execute()
235235
// the child components to finish executing SetParametersAsync
236236
await pendingWork;
237237
}
238-
catch (Exception ex)
238+
catch (NavigationException navigationException)
239239
{
240-
// We need to handle NavigationException specially to ensure it gets properly
241-
// processed through HandleNavigationException rather than being rethrown
242-
if (ex is NavigationException navigationEx)
243-
{
244-
if (_httpContext is not null)
245-
{
246-
await HandleNavigationException(_httpContext, navigationEx);
247-
}
248-
return;
249-
}
250-
else
251-
{
252-
throw;
253-
}
240+
await HandleNavigationException(_httpContext, navigationException);
254241
}
255242
}
256243
}

0 commit comments

Comments
 (0)