tidylab / exceptions

Raising exceptions is an alternative for returning error codes. Exceptions are events, which occurs during the execution of a program that disrupts the normal flow of the program's instructions.
0 stars 0 forks source link

Philosophy #1

Open harell opened 3 years ago

harell commented 3 years ago

See utils::withCallingHandlers in https://adv-r.hadley.nz/conditions.html

References

harell commented 3 years ago
BaseException= R6::R6Class("BaseException", public = list(handler = stop))

NameError = R6::R6Class(inherits =  BaseException)
NameError.set("public", "initilize", function(name) self.handler(name))
NameError = NameError$new()

NameError('HiThere')
harell commented 3 years ago

Consider the mechanism behind