igmtink
igmtink
HHono
Created by igmtink on 5/21/2024 in #help
How to handle multiple errors in (react query) using (hono rpc)?
where did you add this code?
13 replies
HHono
Created by igmtink on 5/21/2024 in #help
How to handle multiple errors in (react query) using (hono rpc)?
I want to display on my sign up layout that multiple error like if Username is already exist or Email is already exist
13 replies
HHono
Created by igmtink on 5/21/2024 in #help
How to handle multiple errors in (react query) using (hono rpc)?
I want to get the error message from hono, but there's a type error, even the type of ResponseType is { error: string } | { data: string }
13 replies
HHono
Created by igmtink on 5/21/2024 in #help
How to handle multiple errors in (react query) using (hono rpc)?
13 replies
HHono
Created by ⚡Z.E.U.S⚡ on 4/27/2024 in #help
Optional params in hono/client
Why do you want an optional parameter? I think you don't need to specify the optional, just leave it :idOrSlug
4 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
that's why I thought also in fetch api standard is also can catch the error using trycatch
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
I got used to Axios where all errors are caught in try-catch.
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
that's why I can't get the error from my server because I use trycatch because the error is returning as a data
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
I mean if the body don't have a content it will consider as reject? so I tried to use throw new HTTPException to reject the promise unlike return c.json({message}, {status: 401}) this has a content even it's error
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
return Promise.reject(data) to pass the error to onError
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
No description
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
but when I use throw new HTTPException it's not rejecting also, is it the same of return c.json({ message: 'Invalid password' }, { status: 401})?
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
No description
22 replies
HHono
Created by igmtink on 4/24/2024 in #help
What is the best way to handle the error?
I want to know how to handle errors inside the Hono server, so I can get the error within the React Query. What I used to handle the error is this: return c.json({ message: 'Invalid password' }, { status: 401 }) on the Hono server. The problem is the 'onError' option of React Query doesn't catch it, so I used try-catch to pass the error to 'onError'. Normally, when fetching using the standard Fetch API and there's an error, React Query automatically passes it to 'onError'. But when using RPC, it doesn't pass to 'onError', so I'm not sure if the way I handled the error in my API route is correct. It still returns the error message as data, so I used try-catch."
22 replies
HHono
Created by igmtink on 4/22/2024 in #help
How to set "credentials: true" in client side using rpc?
No description
14 replies
HHono
Created by igmtink on 4/22/2024 in #help
How to set "credentials: true" in client side using rpc?
when I'm using standard fetch api with credentials: 'include' option, there's no problem at all I got the cookie from server to client, but when using rpc I can't get the cookie from server to client
14 replies
HHono
Created by igmtink on 4/22/2024 in #help
How to set "credentials: true" in client side using rpc?
14 replies