From 4a59ab425026225abb7d37002f6cb3c460041e3f Mon Sep 17 00:00:00 2001 From: Alex Wolf Date: Sun, 1 Dec 2024 20:26:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20user=20feedback=20for=20db?= =?UTF-8?q?()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/Instance.R | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/R/Instance.R b/R/Instance.R index 07ed71c..284b8c9 100644 --- a/R/Instance.R +++ b/R/Instance.R @@ -269,15 +269,16 @@ Instance <- R6::R6Class( # nolint object_name_linter error = function(err) { py_err <- reticulate::py_last_error() if (py_err$type != "NotebookNotSaved") { - cli::cli_abort(c( - "Python {py_err$message}", - "i" = "Run {.run reticulate::py_last_error()} for details" - )) + cli::cli_abort(c( + "Python {py_err$message}", + "i" = "Run {.run reticulate::py_last_error()} for details" + )) } - cli::cli_inform(py_err$message) + message <- gsub(".*NotebookNotSaved: (.*)$", "\\1", py_err$value) + cli::cli_inform(paste("NotebookNotSaved: {message}")) } ) - }, + }, #' @description #' Print an `Instance` #'