Open harell opened 3 years ago
foo <- function() stop("Not Implemented)
NotImplementedError <- function(){ caller_name <- sys.call(sys.parent())[[1]] warning(paste(caller_name, "raised NotImplementedError") }
foo <- exception(foo, NotImplementedError) foo()
- [ ] see [Python Built-in Exceptions](https://docs.python.org/3/library/exceptions.html) - [ ] see Clean Coders p.46
Add exception decorator
https://github.com/tidylab/exceptions
https://github.com/tidylab/exceptions/issues/1
NotImplementedError <- function(){ caller_name <- sys.call(sys.parent())[[1]] warning(paste(caller_name, "raised NotImplementedError") }
foo <- exception(foo, NotImplementedError) foo()