Group Group Group Group Group Group Group Group Group

Redirect view on error 409 duplicate entry?

I have created a wizard to create a new account in my iOS App. I am using a model sheet presentation. First view: basic user information “first name, Lastname, email, country,” second view “rolls and admin rights” I store it on temp swift object, convert to JSON and send it to Web API.

I have one challenge when Web API returns an error like “duplicate user’s email address.” I want to redirect the user to the first view and show an error message. How can I redirect the user to the first view to show him/her the error message?

My feeling is 409 Conflict is the most appropriate, however, seldom seen in the wild of course:

The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to recognize the source of the conflict. Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required.

Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the entity being PUT included changes to a resource which conflict with those made by an earlier (third-party) request, the server might use the 409 response to indicate that it can’t complete the request. In this case, the response entity would likely contain a list of the differences between the two versions in a format defined by the response Content-Type.