Quick fix for uncaught 409 on slug conflict. #1381
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This error is raised when you have opted in to create a new project, but asked for an existing slug.
There are two slightly different recommendations in the two issues that discuss this problem:
This PR is a simple cosmetic display of the error; (note: I think it's fair in this case to terminate the session, since in this case we opted-in to create a new project, and not to push into an existing project—which is a way to reuse a slug; unless, there is a case where the slug is "taken" by a project you can't see?)
This does not change the workflow, but only fixes the displayed message to make it more palatable. I reckon that my code is ugly ("error as any", yuck), and maybe what we want is a clean "api error with messages" instead, like we have just above these lines. In that case there is a bit of work to do on the platform before we would fix this in the client?
I'm putting up this "ugly" solution as a PR, but feel free to reject it in favor of a nicer approach. The workflow with this PR is:
closes #909
closes #713