From d11a1ea1567dd40eec6d281b6d2836dd4d79b271 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 19 Sep 2011 14:06:23 +0100 Subject: [PATCH] catch errors during printing of frame locals tryCatch is R's handler-case. (Spent some time wondering why withCallingHandlers wasn't working, but that's handler-bind.) --- swank.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/swank.R b/swank.R index f0c0d15..0b48ed3 100644 --- a/swank.R +++ b/swank.R @@ -425,7 +425,12 @@ computeRestartsForEmacs <- function (sldbState) { objs <- ls(envir=frame) list(lapply(objs, function(name) { list(quote(`:name`), name, quote(`:id`), 0, - quote(`:value`), printToString(eval(parse(text=name), envir=frame))) }), + quote(`:value`), + tryCatch({ + printToString(eval(parse(text=name), envir=frame)) + }, error=function(c) { + sprintf("error printing object") + }))}), list()) } -- 2.30.2