diff --git a/rsconnect/api.py b/rsconnect/api.py index 604d835d..bfee7f81 100644 --- a/rsconnect/api.py +++ b/rsconnect/api.py @@ -254,7 +254,10 @@ def deploy(uri, api_key, app_id, app_name, app_title, tarball): if task['code'] != 0: # app failed to deploy - raise RSConnectException('Failed to deploy successfully') + err_msg = 'Failed to deploy successfully' + if 'error' in task: + err_msg += ': ' + task['error'] + raise RSConnectException(err_msg) # app deployed successfully config = api.app_config(app['id']) diff --git a/rsconnect/static/connect.js b/rsconnect/static/connect.js index f5d91cc9..14182b77 100644 --- a/rsconnect/static/connect.js +++ b/rsconnect/static/connect.js @@ -250,9 +250,13 @@ define([ inspectEnvironment: function() { var path = Jupyter.notebook.notebook_name; - // TODO: cannot assume rsconnect is installed in the kernel environment - var cmd = "!python -m rsconnect.environment ${PWD}/" + path; - console.log("executing: " + cmd); + try { + // cannot assume rsconnect is installed in the kernel environment + var cmd = ["!", Jupyter.notebook.kernel_selector.kernelspecs[Jupyter.notebook.kernel.name].spec.argv[0], " -m rsconnect.environment ${PWD}/", path].join(""); + console.log("executing: " + cmd); + } catch (e) { + return $.Deferred().reject(e); + } var result = $.Deferred(); var content = ""; @@ -760,12 +764,12 @@ define([ " ", '
', ' ', - ' ', + ' ', ' Publish document with source code
', ' Choose this option if you want to create a scheduled report or rebuild your document on the server', "
", ' ', - ' ', + ' ', ' Publish finished document only
', ' Choose this option to publish a snapshot of the notebook as it appears in Jupyter', "
", @@ -910,7 +914,7 @@ define([ addValidationMarkup( false, txtTitle, - "Failed to publish. " + xhr.responseJSON.message + xhr.responseJSON.message ); togglePublishButton(true); }