use .. warning:: (#17226)

* remove unnecessary when statement

* remove outdated codes

* use warnings
This commit is contained in:
flywind 2021-03-04 18:34:55 +08:00 • committed by GitHub
commit 5670b848cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 16 deletions

View file

@ -1939,8 +1939,7 @@ when notJSnotNims:
## With this hook you can influence exception handling on a global level.
## If not nil, every 'raise' statement ends up calling this hook.
##
## **Warning**: Ordinary application code should never set this hook!
## You better know what you do when setting this.
## .. warning:: Ordinary application code should never set this hook! You better know what you do when setting this.
##
## If `globalRaiseHook` returns false, the exception is caught and does
## not propagate further through the call stack.
@ -1950,8 +1949,7 @@ when notJSnotNims:
## thread local level.
## If not nil, every 'raise' statement ends up calling this hook.
##
## **Warning**: Ordinary application code should never set this hook!
## You better know what you do when setting this.
## .. warning:: Ordinary application code should never set this hook! You better know what you do when setting this.
##
## If `localRaiseHook` returns false, the exception
## is caught and does not propagate further through the call stack.
@ -2408,7 +2406,7 @@ when notJSnotNims and hostOS != "standalone":
proc setCurrentException*(exc: ref Exception) {.inline, benign.} =
## Sets the current exception.
##
## **Warning**: Only use this if you know what you are doing.
## .. warning:: Only use this if you know what you are doing.
currException = exc
elif defined(nimscript):
proc getCurrentException*(): ref Exception {.compilerRtl.} = discard