adobe / aio-cli-plugin-app

Create, Build and Deploy Cloud Native Applications
Apache License 2.0
19 stars 35 forks source link

unfriendly error when re-deploying #560

Open purplecabbage opened 2 years ago

purplecabbage commented 2 years ago

Describe the bug

The error message is not clear

To Reproduce run aio app deploy on a production workspace that has already been deployed+approved

Expected behavior A clear error message stating the error condition, and how to fix it is shown

Instead it looks like the entire error object is output, which is not very friendly

test-stage-july22 AIO_CLI_ENV=stage aio app deploy
✔ Built 1 action(s) for 'dx/excshell/1'
✔ Building web assets for 'dx/excshell/1'
✔ Deployed 1 action(s) for 'dx/excshell/1'
✔ Deploying web assets for 'dx/excshell/1'
Your deployed actions:
web actions:
  -> https://development-918-jessestagetest.dev.runtime.adobe.io/api/v1/web/dx-excshell-1/generic 
To view your deployed application:
  -> https://development-918-jessestagetest.dev.runtime.adobe.io/index.html
To view your deployed application in the Experience Cloud shell:
  -> https://experience-stage.adobe.com/?devMode=true#/custom-apps/?localDevUrl=https://development-918-jessestagetest.dev.runtime.adobe.io/index.html
⠴ Updating Extension Points 'endpoints' in Workspace=Production... ›   Error: [CoreConsoleAPISDK:ERROR_UPDATE_WORKSPACE_ENDPOINTS] 400 - Bad Request 
 ›   ([{"template":"ERR_MSG_RETRY_OR_CONTACT","message":"{\"errors\":[{\"error_code\":\"1400\",\"message\":\"Problem occured - App in 
 ›   DRAFT|REJECTED|RETRACTED status can only be updated\"}]}"}])
⠦ Updating Extension Points 'endpoints' in Workspace=Production...%            
aiojbot commented 2 years ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-1740

shazron commented 1 year ago

This seems to be a general error object formatting issue in aio-lib-core-errors but I suspect we need to tweak aio-lib-console to pretty print errors https://github.com/adobe/aio-lib-console/blob/65087ad0c3f856d1c4ca0011fdec8c2ccb1ff217/src/index.js#L1260 (and similar libs)