Skip to content

Commit

Permalink
Merge pull request #96 from DevNode-Dev/fix/fetCommunities-error
Browse files Browse the repository at this point in the history
handled error in fetch communities
  • Loading branch information
ap-atul authored May 11, 2023
2 parents 93940a1 + f4d513a commit 542598b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/web/src/server/trpc/router/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export const publicRouter = router({
cursor: z.string().nullish(),
}))
.query(async ({input}) => {
return await queryHandler.fetchCommunities(input.first, input.cursor);

try{
return await queryHandler.fetchCommunities(input.first, input.cursor);
}
catch(e){
return e?.response?.data?.communityIndex;
}
}),

fetchAllCommunities: publicProcedure.query(async () => {
Expand Down

0 comments on commit 542598b

Please sign in to comment.