Skip to content

Commit 3e77c62

Browse files
committed
Throw on NotFound without global router.
1 parent f57b0b7 commit 3e77c62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Components/Components/src/NavigationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ private void NotFoundCore()
208208
if (_notFound == null)
209209
{
210210
// global router doesn't exist, no events were registered
211-
NavigateTo($"{BaseUri}not-found");
211+
throw new InvalidOperationException("No handler is subscribed to the OnNotFound event. Ensure that the application has a global router or manually subscribe to the OnNotFound event.");
212212
}
213213
else
214214
{

0 commit comments

Comments
 (0)