tryCatchLog icon indicating copy to clipboard operation
tryCatchLog copied to clipboard

Support custom messages for catched conditions

Open aryoda opened this issue 8 years ago • 2 comments

To give the user a better error (or other condition) message a feature to replace all or selected conditions (or at least condition messages) by custom conditions (messages) would be helpful.

See: https://stackoverflow.com/q/47871392/4468078

See also the rlang package: https://github.com/r-lib/rlang Lionel Henry gave a good presentation at erum 2018 ("Harness the R condition system") and explained the newest extensions around condition handling (wait for the slides to be published at http://2018.erum.io).

Conditions are signaled by 'signalCondition'.

See also:

  • https://github.com/rappster/conditionr
  • rlang package: https://github.com/r-lib/rlang
  • R.oo package (function throw()): https://cran.r-project.org/web/packages/R.oo/index.html

aryoda avatar Dec 21 '17 22:12 aryoda

Rethrowing a caught condition as another condition is a duplicate of #30 (could be solved together).

Just replacing the message is new and separate requirement...

aryoda avatar Oct 22 '18 19:10 aryoda

Are there any real use cases or requests for this?

I tend to reject and archive this feature request...

aryoda avatar Jul 31 '22 16:07 aryoda