Skip to content

Commit

Permalink
fix: #[server] macro error type detection (#2298)
Browse files Browse the repository at this point in the history
In most cases when you return `Result<..., ServerFnError<E>>` this worked but when you tried
`Result<..., leptos::ServerFnError<E>>` then it didn't.
  • Loading branch information
maccesch authored Feb 16, 2024
1 parent 830fba7 commit 23bc892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server_fn_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ fn err_type(return_ty: &Type) -> Result<Option<&GenericArgument>> {
{
if let Some(segment) = pat.path.segments.last() {
if segment.ident == "ServerFnError" {
let args = &pat.path.segments[0].arguments;
let args = &segment.arguments;
match args {
// Result<T, ServerFnError>
PathArguments::None => return Ok(None),
Expand Down

0 comments on commit 23bc892

Please sign in to comment.