Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/commands/codepush/deployment/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ export default class CodePushDeploymentHistoryCommand extends AppCommand {
return success();
} catch (error) {
debug(`Failed to get list of CodePush deployments - ${inspect(error)}`);
if (error.statusCode === 404) {
if (error.statusCode === 404 && error.response.body === `Deployment "${this.deploymentName}" does not exist.`) {
const deploymentNotExistErrorMsg = `The deployment ${chalk.bold(this.deploymentName)} does not exist.`;
return failure(ErrorCodes.Exception, deploymentNotExistErrorMsg);
} else if (error.statusCode === 404) {
const appNotFoundErrorMsg = `The app ${
this.identifier
} does not exist. Please double check the name, and provide it in the form owner/appname. \nRun the command ${chalk.bold(
`${scriptName} apps list`
)} to see what apps you have access to.`;
return failure(ErrorCodes.NotFound, appNotFoundErrorMsg);
} else if (error.statusCode === 400) {
const deploymentNotExistErrorMsg = `The deployment ${chalk.bold(this.deploymentName)} does not exist.`;
return failure(ErrorCodes.Exception, deploymentNotExistErrorMsg);
} else {
return failure(ErrorCodes.Exception, error.response.body);
}
Expand Down
2 changes: 1 addition & 1 deletion test/commands/codepush/deployment/history-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe("codepush deployment history", () => {
.get(`/v0.1/apps/${testData.fakeAppIdentifier}/deployments/${testData.fakeNonExistentDeploymentName}/releases`)
.reply((uri, requestBody) => {
requestReleasesSpy();
return [400, {}];
return [404, `Deployment "${testData.fakeNonExistentDeploymentName}" does not exist.`];
})
.get(`/v0.1/apps/${testData.fakeNonExistentAppIdentifier}/deployments/${testData.fakeDeploymentName}/releases`)
.reply((uri, requestBody) => {
Expand Down