Skip to content

Commit

Permalink
Merge pull request #134 from rstudio/mm-mode-message
Browse files Browse the repository at this point in the history
Better error message on app mode mismatch
  • Loading branch information
mmarchetti authored Jun 17, 2020
2 parents 565596d + 6dc7d2d commit da18bae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rsconnect/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,14 @@ def _gather_basic_deployment_info_for_framework(
if not new and app_id is None:
# Possible redeployment - check for saved metadata.
# Use the saved app information unless overridden by the user.
app_id, app_mode = app_store.resolve(connect_server.url, app_id, app_mode)
app_id, existing_app_mode = app_store.resolve(connect_server.url, app_id, app_mode)
if existing_app_mode and app_mode != existing_app_mode:
msg = (
"Deploying with mode '%s',\n"
+ "but the existing deployment has mode '%s'.\n"
+ "Use the --new option to create a new deployment of the desired type."
) % (app_mode.desc(), existing_app_mode.desc())
raise api.RSConnectException(msg)

if directory[-1] == "/":
directory = directory[:-1]
Expand Down

0 comments on commit da18bae

Please sign in to comment.