Skip to content

Commit 33992f3

Browse files
committed
add error to toast
1 parent a25ade1 commit 33992f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/chatrooms/[chatroomId]/components/invite-chatroom-dialog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ export function InviteChatroomButton({
124124
setSelectedUsers([]);
125125
toast.success("Successfully invited user(s) to chatroom");
126126
} catch (error) {
127-
console.error("Error inviting users:", error);
128-
toast.error("Error inviting user(s)");
127+
if (error instanceof Error) {
128+
toast.error(error.message);
129+
}
129130
}
130131
};
131132

0 commit comments

Comments
 (0)