Skip to content
Prev 8378 / 12125 Next

[R-pkg-devel] tryCatch() doesn't capture errors due to && or || with R CMD check --as-cran

Very much on purpose, even though we (the R Core team) may not
have said so loudly.

The problem is that too many "smart" people, including the
authors of certain widely used testing packages do call
tryCatch(), or suppressWarnings() and similar to eliminate
warnings and errors in a situation we really *do* want these to
be shown.

For instance, we, the Matrix package authors, have planned to
deprecate certain usages of  as(*, "<someMatrixClass>")  and
give deprecation warnings -- see  help(Deprecated) -- so the
users and package authors can see the undesired usages and
eventually update their code.

No, because of too much use of suppressWarnings() they *NEVER
EVER* see *any* deprecation warnings for all their own code
which silences these warnings and for all (often 100%) of their
tests where they use the famous test...t  package ...

An additional reason for such a non-suppressible error is that
when you find such warnings/errors in package testing of
packages with many dependencies, if the warning/error is raised
and you *do* see it, it may *still* not at all be easy to see
from which of the (sometimes 20--100) packages that are in use
the problem is caused.

I hope you understand that such "obnoxious" behavior is
rational and desirable in such rare cases.

Best regards,
Martin


--
Martin Maechler
ETH Zurich  and  R Core team
Message-ID: <25360.52627.355395.525599@stat.math.ethz.ch>
In-Reply-To: <EYtAuD5vXFFQeFENJu_gUOXYiZoeRc85COpFtZDOLPWH4SgCxhZ-wR6qjssrCIAgqm3uxKSW3dSfDxqShu1_HkxROiND9PjbiuVTRQYpKQU=@protonmail.com>