From: Christophe Rhodes Date: Mon, 19 Sep 2011 13:06:23 +0000 (+0100) Subject: catch errors during printing of frame locals X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=d11a1ea1567dd40eec6d281b6d2836dd4d79b271;p=swankr.git 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.) --- 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()) }