Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/actions/bookmark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ const createBookmarkHandler = async (
});
reloadBookmarkPage();
return { data: addedBookmark };
} catch (error: any) {
return { error: error.message || 'Failed to create comment.' };
} catch (error: unknown) {
if (error instanceof Error) {
return { error: error.message};
}
return { error: 'Failed to create comment.' };
}
};

Expand All @@ -58,8 +61,11 @@ const deleteBookmarkHandler = async (
});
reloadBookmarkPage();
return { data: deletedBookmark };
} catch (error: any) {
return { error: error.message || 'Failed to create comment.' };
} catch (error: unknown) {
if (error instanceof Error) {
return { error: error.message};
}
return { error: 'Failed to create comment.' };
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/actions/bounty/userActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function submitBountyHandler(data: BountySubmissionData) {
},
});
return { data: bountySubmission };
} catch (error: any) {
} catch (error: unknown) {
if (error instanceof Prisma.PrismaClientKnownRequestError) {
if (error.code === 'P2002') {
return {
Expand Down
14 changes: 10 additions & 4 deletions src/actions/comment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,11 @@ const createCommentHandler = async (
revalidatePath(data.currentPath);
}
return { data: comment };
} catch (error: any) {
return { error: error.message || 'Failed to create comment.' };
} catch (error: unknown) {
if (error instanceof Error) {
return { error: error.message};
}
return { error: 'Failed to create comment.' };
}
};
const updateCommentHandler = async (
Expand Down Expand Up @@ -452,8 +455,11 @@ const pinCommentHandler = async (
revalidatePath(currentPath);
}
return { data: updatedComment };
} catch (error: any) {
return { error: error.message || 'Failed to pin comment.' };
} catch (error: unknown) {
if (error instanceof Error) {
return { error: error.message};
}
return { error: 'Failed to pin comment.' };
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/utiles/appx-check-mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function checkUserEmailForPurchase(
headers,
});
return await response.json();
} catch (error: any) {
} catch (error: unknown) {
if (error instanceof Error) {
console.log(error.message);
}
Expand Down