500 code is returned when trying to create a user with not unique name

Description

I noticed an issue when I was executing OLMIS-2214. When one tries to create a user with a not unique name, the request to the auth service returns the 500 code and an error in the console. Also, the request to the UserContactDetails endpoint returns a confusing error message.

Reproduction steps:

  1. Execute steps 1-3 from the test case.

Expected results:

  • Instead of the 500 code and the error, the 400 code should be returned;

  • The error message concerning the request to the UserContactDetails endpoint should be user-friendly, i.e. state which field is an invariant and cannot be changed.

Environment

None

Status

Assignee

Unassigned

Reporter

Joanna Bebak

Time tracking

24h

Epic Link

Components

Priority

Major
Configure