From hpages at fhcrc.org  Tue Jan 25 19:13:11 2011
From: hpages at fhcrc.org (=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=)
Date: Tue, 25 Jan 2011 10:13:11 -0800
Subject: [Rd] Regression in error handling with R >= 2.12
Message-ID: <4D3F12B7.9060809@fhcrc.org>

Hi list,

When nesting 2 function calls, if an exception occurs during the inner 
call, the error message will display properly:

   bar <- function() stop("bar() is broken")
   foo <- function(x) {x * (x - 2)}

   > foo(bar())
   Error in bar() : bar() is broken

However, starting with R 2.12, if foo() is a generic function, we only
get the following not-so-informative message:

   setMethod("foo", "numeric", function(x) {x * (x - 2)})

   > foo(bar())
   Error in foo(bar()) :
     error in evaluating the argument 'x' in selecting a method for 
function 'foo'

With versions prior to R 2.12, we were getting the full story:

   > foo(bar())
   Error in bar() : bar() is broken
   Error in foo(bar()) :
     error in evaluating the argument 'x' in selecting a method for 
function 'foo'

Could this behavior be restored?

Thanks,
H.

-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] Regression in error handling with R >= 2.12
=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=