rsconnect
rsconnect copied to clipboard
escape codes presented by IDE when target application deleted
Steps to reproduce:
- deploy a Shiny application to a Connect server using push-button deployment in the RStudio IDE
- delete that Shiny application from Connect
- attempt to redeploy using the publish button in the RStudio IDE
This message includes an escape code because the IDE attempts to rewrite the application lookup error with:
https://github.com/rstudio/rstudio/blob/8244ebc49cc3188f04aa26bb2c2377aeda315817/src/cpp/session/modules/SessionRSConnect.R#L212-L218
You can see similar information locally with:
tryCatch({
rsconnect:::getAppById(appId, account, server, hostUrl)
}, error=function(e)conditionMessage(e))
That produces (redacted by hand):
[1] "\033[38;5;232mCan't find app with id \"APP_ID\"\033[39m\n\033[1mCaused by error in `GET()`:\033[22m\n\033[38;5;232m\033[33m!\033[38;5;232m <https://SERVER_HOSTNAME/__api__/applications/APP_ID> failed with HTTP status 404\nThe requested object does not exist.\033[39m"
The rsconnect:::getAppById() function should produce output that can be included by the IDE in its UI.
Probably need to locally set options(crayon.enabled = FALSE).