You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love the RPC feature, but it seems like output types of onError handler are not unioned with a path's output type. Is this the intended behavior? A request can return any of its internal return types AND whatever onError returns in case something is thrown, so the types should reflect that right?
Edit: hmm also any responses returned from middlewares are ignored as well it seems? Maybe I'm doing something wrong. If I'm using zValidator, RPC client types ignore the error that zValidator might return in case of failure. Even if I use the hook of zValidator and return something like c.json({ error: "something" }) from the hook, RPC client is unaware of it. Am I doing something wrong or is this where the feature sits at the moment? It seems like only the "handler" is taken into account, if that is the case, I'd need to cram everything into the handler to get typesafe routes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Love the RPC feature, but it seems like output types of onError handler are not unioned with a path's output type. Is this the intended behavior? A request can return any of its internal return types AND whatever onError returns in case something is thrown, so the types should reflect that right?
Edit: hmm also any responses returned from middlewares are ignored as well it seems? Maybe I'm doing something wrong. If I'm using zValidator, RPC client types ignore the error that zValidator might return in case of failure. Even if I use the hook of zValidator and return something like
c.json({ error: "something" })
from the hook, RPC client is unaware of it. Am I doing something wrong or is this where the feature sits at the moment? It seems like only the "handler" is taken into account, if that is the case, I'd need to cram everything into the handler to get typesafe routes.Beta Was this translation helpful? Give feedback.
All reactions