From cdfad63bb6b2dfaf83d6c45866937fbfa5febcd2 Mon Sep 17 00:00:00 2001 From: "Roger D. Peng [audrey]" Date: Fri, 21 Mar 2008 10:39:52 -0400 Subject: [PATCH] Use tryCatch to suppress the warning message --- R/filehash-RDS.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/filehash-RDS.R b/R/filehash-RDS.R index 9750cd9..df7eba3 100644 --- a/R/filehash-RDS.R +++ b/R/filehash-RDS.R @@ -119,10 +119,12 @@ setMethod("dbFetch", signature(db = "filehashRDS", key = "character"), ofile <- objectFile(db, key) ## Open connection - con <- try({ + con <- tryCatch({ gzfile(ofile, "rb") - }, silent = TRUE) - if(inherits(con, "try-error")) + }, condition = function(cond) { + cond + }) + if(inherits(con, "condition")) stop(gettextf("unable to obtain value for key '%s'", key)) on.exit(close(con)) -- 2.11.4.GIT