Skip to content

Bug: Changing role error is not specific to backend error #1932

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

Closed
Emyrk opened this issue May 31, 2022 · 5 comments · Fixed by #1938
Closed

Bug: Changing role error is not specific to backend error #1932

Emyrk opened this issue May 31, 2022 · 5 comments · Fixed by #1938
Assignees
Labels
site Area: frontend dashboard
Milestone

Comments

@Emyrk
Copy link
Member

Emyrk commented May 31, 2022

Steps to Reproduce

  1. Go to Users page
  2. Attempt to change your own roles
  3. Error is: Error on update the user roles

Expected

The backend payload is {"message":"You cannot change your own roles."}. We should elevate a more detailed error in the toast error.

Actual

Error is always the same error regardless of backend text.

Logs

Screenshot

Screenshot from 2022-05-31 15-15-55

Notes

Our frontend does constant errors in a lot of places, we should elevate backend text.

@Emyrk Emyrk added bug 🐛 site Area: frontend dashboard labels May 31, 2022
@Emyrk
Copy link
Member Author

Emyrk commented May 31, 2022

@presleyp pinging you on this. The UI doesn't show the right error for changing your own role.

@presleyp presleyp self-assigned this May 31, 2022
@presleyp
Copy link
Contributor

@BrunoQuaresma I started on this, just having the XService display the error's message if it's an Error, else the standard error from Language, and the problem is that it shows "Request failed with status 400" instead of the nice error message that I see in the Network tab. I think you had thoughts about how we can get the good error message into XState, right?

@Emyrk
Copy link
Member Author

Emyrk commented May 31, 2022

@presleyp I did this for suspended users logging in: #1849

Bruno helped me out.

@misskniss
Copy link

Please add your planning poker estimate with ZenHub @presleyp

@nadzeyav
Copy link

nadzeyav commented Jun 1, 2022

Verified in Coder v0.0.0-devel+6be8a37.

The following cases verified:
Admin user is changing his own role -> error You cannot change your own roles.
Admin suspend himself -> You cannot suspend yourself

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

Successfully merging a pull request may close this issue.

4 participants