Merge branch 'master' into intigrate-collect-assets
This commit is contained in:
1 parent
ffb5de91d1
commit
f976e08f71
379 files changed
+1962
-13517
No files matched your search
@@ -84,7 +84,7 @@ use warp::{
|
||||
/// async move {
|
||||
/// let req = warp::hyper::Request::from_parts(parts, bytes.into());
|
||||
/// service.run(req).await.map_err(|err| {
|
||||
/// log::error!("Server function error: {}", err);
|
||||
/// tracing::error!("Server function error: {}", err);
|
||||
/// warp::reject::reject()
|
||||
/// })
|
||||
/// }
|
||||
@@ -142,8 +142,18 @@ pub fn register_server_fns(server_fn_route: &'static str) -> BoxedFilter<(impl R
|
||||
async move {
|
||||
let req = warp::hyper::Request::from_parts(parts, bytes.into());
|
||||
service.run(req).await.map_err(|err| {
|
||||
log::error!("Server function error: {}", err);
|
||||
warp::reject::reject()
|
||||
tracing::error!("Server function error: {}", err);
|
||||
|
||||
struct WarpServerFnError(String);
|
||||
impl std::fmt::Debug for WarpServerFnError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl warp::reject::Reject for WarpServerFnError {}
|
||||
|
||||
warp::reject::custom(WarpServerFnError(err.to_string()))
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -222,7 +232,7 @@ pub fn render_ssr<P: Clone + serde::Serialize + Send + Sync + 'static>(
|
||||
res
|
||||
}
|
||||
Err(err) => {
|
||||
log::error!("Failed to render ssr: {}", err);
|
||||
tracing::error!("Failed to render ssr: {}", err);
|
||||
Response::builder()
|
||||
.status(500)
|
||||
.body("Failed to render ssr".into())
|
||||
|
||||
Reference in new issue
Block a user