Skip to content

Fix non existing deployment error message#2083

Merged
thewulf7 merged 1 commit intomicrosoft:masterfrom
louiszawadzki:louiszawadzki/clarify-history-wrong-deployment-error-message
Sep 13, 2022
Merged

Fix non existing deployment error message#2083
thewulf7 merged 1 commit intomicrosoft:masterfrom
louiszawadzki:louiszawadzki/clarify-history-wrong-deployment-error-message

Conversation

@louiszawadzki
Copy link
Copy Markdown
Contributor

Hi,

When running the appcenter codepush deployment history Deployment --app Org/App command when Org/App exists but does not have a deployment called "Deployment" I get the following error output:

{"succeeded":false,"errorCode":6,"errorMessage":"The app Org/App does not exist. Please double check the name, and provide it in the form owner/appname. \nRun the command \u001b[1mappcenter apps list\u001b[22m to see what apps you have access to."}

This error message is misleading since it tells the user that the app does not exist, and in this case it's the deployment that does not exist.

I ran the command with the --debug flag to understand what result was returned from the backend, and I got this output:

Using appcenter-cli version: 2.11.0
logFilter, request: {
  "rawResponse": false,
  "queryString": {},
  "url": "https://api.appcenter.ms/v0.1/apps/Org/App/deployments/Deployment/releases",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json; charset=utf-8",
    "user-agent": "appcenterCli/2.11.0 NodeJS/v18.6.0 darwin/21.6.0",
    "x-api-token": "xxx",
    "internal-request-source": "cli",
    "diagnostic-context": "xxx",
    "cli-command-name": "codepush deployment history"
  },
  "body": null
}
Response status code: 404
Body: Deployment "Deployment" does not exist.

It looks like this API now returns a 404 code instead of a 400 previously.

I opened this PR in the case this API change is made to last, but I think it might actually make more sense to change the API response to return a 400 as before so this issue is fixed for all users.

@louiszawadzki louiszawadzki requested a review from a team as a code owner September 6, 2022 08:37
@ghost
Copy link
Copy Markdown

ghost commented Sep 6, 2022

CLA assistant check
All CLA requirements met.

@MikhailSuendukov
Copy link
Copy Markdown
Contributor

Hello and thank you for the pull request, we need some time to review and test it.

@AnatolyPristensky
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@thewulf7 thewulf7 merged commit ecc2bf9 into microsoft:master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants