Changing username leads to 422 error without any user visible error message on the page

Summary

On the Gitlab.com in the User settings -> Account when trying to change a username the 422 error is thrown. It's visible through the developer console but from the user perspective only an empty red bar on the top of the page appears.

Steps to reproduce

  • Go to the User settings -> Account
  • Try to change a username to something simple and probably taken (I tried natalia)
  • Click Update username in the modal
  • Observe the red bar on the top of the page and 422 error in the console

What is the current bug behavior?

422 error is not clearly visible to user; instead user can see only an empty red bar

What is the expected correct behavior?

Error should be displayed with a correct error message warning user that something went wrong

Relevant logs and/or screenshots

Screen_Shot_2018-11-21_at_12.23.28

Output of checks

This bug happens on GitLab.com