deprecate system.onRaise; fixes #1652
This commit is contained in:
parent
077f24ab2d
commit
7ace82440f
1 changed files with 4 additions and 1 deletions
|
|
@ -3386,12 +3386,15 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
var e = getCurrentException()
|
var e = getCurrentException()
|
||||||
return if e == nil: "" else: e.msg
|
return if e == nil: "" else: e.msg
|
||||||
|
|
||||||
proc onRaise*(action: proc(e: ref Exception): bool{.closure.}) =
|
proc onRaise*(action: proc(e: ref Exception): bool{.closure.}) {.deprecated.} =
|
||||||
## can be used in a ``try`` statement to setup a Lisp-like
|
## can be used in a ``try`` statement to setup a Lisp-like
|
||||||
## `condition system`:idx:\: This prevents the 'raise' statement to
|
## `condition system`:idx:\: This prevents the 'raise' statement to
|
||||||
## raise an exception but instead calls ``action``.
|
## raise an exception but instead calls ``action``.
|
||||||
## If ``action`` returns false, the exception has been handled and
|
## If ``action`` returns false, the exception has been handled and
|
||||||
## does not propagate further through the call stack.
|
## does not propagate further through the call stack.
|
||||||
|
##
|
||||||
|
## *Deprecated since version 0.18.1*: No good usages of this
|
||||||
|
## feature are known.
|
||||||
if not isNil(excHandler):
|
if not isNil(excHandler):
|
||||||
excHandler.hasRaiseAction = true
|
excHandler.hasRaiseAction = true
|
||||||
excHandler.raiseAction = action
|
excHandler.raiseAction = action
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue