Return a 404 when paring the route fails (#3860)

* return a 404 when paring the route fails

* add a playwright test for fullstack routing status codes

* Fix new playwright test

* document SSRError

* Make SSRError public and fix clippy

* Move the error display bound to the routable trait

* fix clippy

* return a more generic 404 message

* fix router tests
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-03-14 00:51:44 -07:00
1 parent 7b7357037f
commit 09a4b5eb4e
18 files changed
+253 -46

No files matched your search

+2 -6
View File
@@ -3,7 +3,7 @@ use crate::{
Properties, ScopeId, Template, TemplateAttribute, TemplateNode, VNode,
};
use std::{
any::{Any, TypeId},
any::Any,
backtrace::Backtrace,
cell::{Ref, RefCell},
error::Error,
@@ -493,11 +493,7 @@ impl Display for CapturedError {
impl CapturedError {
/// Downcast the error type into a concrete error type
pub fn downcast<T: 'static>(&self) -> Option<&T> {
if TypeId::of::<T>() == (*self.error).type_id() {
self.error.as_any().downcast_ref::<T>()
} else {
None
}
self.error.as_any().downcast_ref::<T>()
}
}