You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And probably throw an error when a condition of the excepted class failed to be caught, instead of returning NULL. This way it can safely be used in unit tests and other situations where you expect a condition. WDYT @hadley?
The text was updated successfully, but these errors were encountered:
How about just taking an optional condition class defaulting to "condition" then? If not caught, return NULL. There's currently no easy way to catch a condition whose class is in a variable. Then the testthat helper can be implemented around catch_cnd().
It feels like catch_cnd() is not complete in its current state, at least for programming where the caller invariably has to check for the condition type in addition to checking for NULL.
And probably throw an error when a condition of the excepted class failed to be caught, instead of returning
NULL
. This way it can safely be used in unit tests and other situations where you expect a condition. WDYT @hadley?The text was updated successfully, but these errors were encountered: