Skip to content

feat: improve error reporting for failed user invitations (#1050) #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rishiraj38
Copy link

Description

This PR improves error reporting for failed user invitations by replacing the generic error message with specific, contextual messages based on the error returned from the backend.

Changes Made

  • Updated error handling in the invite function to check for specific error messages.
  • Added clear, user-friendly error messages for:
    • Email already exists
    • Invalid email format
    • User limit reached
    • Fallback for unknown errors

Related Issue

Closes #1050

@rishiraj38
Copy link
Author

Hi @zihanKuang @leecalcote
I’ve submitted a PR for #1050. Would love your feedback when you have time. Thank you! 🙌

@rishiraj38 rishiraj38 force-pushed the improve-invitation-error-messages branch from 5c6baef to 2a3b18c Compare June 27, 2025 15:46
@vr-varad
Copy link
Contributor

@rishiraj38
Thank you for your contribution!
Let's discuss this during the website call today at 7 AM CT

Add it as an agenda item to the meeting minutes, if you would :)

@FaheemOnHub
Copy link
Contributor

@rishiraj38
Thank you for your contribution!
Let's discuss this during the website call today at 7 AM CT

Add it as an agenda item to the meeting minutes, if you would :)

Copy link
Contributor

@hortison hortison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@FaheemOnHub, what do you think?

@rishiraj38
Copy link
Author

@vr-varad @FaheemOnHub Apologies for missing the recent meetings — I’ve been tied up with my college exams. I truly appreciate your understanding. Also, a heartfelt thank you to @hortison for approving my very first contribution to Layers. Grateful to be part of this journey!

@rishiraj38 rishiraj38 requested a review from hortison July 16, 2025 05:59
if (errorMessage.includes('email already exists')) {
handleError('Invitation failed: Email address already exists.');
} else if (errorMessage.includes('invalid email')) {
handleError('Invitation failed: Invalid email format.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just display the error message instead of hardcoding it ?

@FaheemOnHub
Copy link
Contributor

Thanks!

@FaheemOnHub, what do you think?

It recommended not to hardcode errors , we majorly do this on backend

@rishiraj38 rishiraj38 force-pushed the improve-invitation-error-messages branch from 2a3b18c to 1e28f7d Compare July 16, 2025 14:02
Rishi Raj and others added 2 commits July 16, 2025 19:34
)

Signed-off-by: Rishi Raj <rishiraj@Mac.lan>
Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
@rishiraj38 rishiraj38 force-pushed the improve-invitation-error-messages branch from 1e28f7d to 6fff8b0 Compare July 16, 2025 14:04
@rishiraj38
Copy link
Author

@FaheemOnHub @Namanv0509 @hortison Please review the latest commit.

@rishiraj38 rishiraj38 requested a review from Namanv0509 July 16, 2025 14:07
Copy link
Contributor

@FaheemOnHub FaheemOnHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is an improvement , but technical error messages might not feel good to users.

Can u please provide some ss of error messages received after this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Improve Error Reporting for Failed User Invitations
5 participants