-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
rlang conditions allow us to assign custom classes (allowing selective filtering), pack in relevant information within the condition object, and provide more informative traces than traceback. However, some of this functionality is not at all obvious for abort, and most/all of it is not obvious or activated for warn and inform. Plus, packing information inside the object rather than the message may actually obscure warn and inform and require an extra step for abort without some duplication inside the main message.
Help users unfamiliar with rlang conditions by:
- Providing a short tutorial periodically when we use rlang conditions, overviewing how to view condition fields, how to get an improved trace, and how to enable these things for
warnandinformwhen they aren't available by default (on some/all R distributions) (requiringglobal_entrace()first instead). Try this usinginformwith a.frequency. - Making it easy in
Abort,Warn, to package in some informative objects that should be printed, and others whose names should be listed, placing them either with appropriate package-name prefixes as condition fields, or as a list condition field. - Consider an analogous
Informfunction. - In Abort, provide the caller's function name rather than "Error in
Abort", usingcallparameter. - Tweak
initto adjust the wrapping based on the actual prefixes used byrlang, e.g., "! " forabort. (Might need to know ifglobal_entraceis active) - Make sure there's a way to use
recover; look into what happened with this Issue. - Make condition class names more readily available for selective recovery? Also, maybe have length 2 or 3 subclasses that will allow to catch all errors or all conditions from this package?