diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-12-18 11:22:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-12-18 11:22:42 -0300 |
commit | 409256b7849ec5ab3296cb0ab9eba3d65955d5ea (patch) | |
tree | 13d6327093e900cab0b23c4d09f344a281630c73 /manual | |
parent | b17178b27a55bd5eeb51538bec935972fd58f1ea (diff) | |
download | lua-409256b7849ec5ab3296cb0ab9eba3d65955d5ea.tar.gz lua-409256b7849ec5ab3296cb0ab9eba3d65955d5ea.tar.bz2 lua-409256b7849ec5ab3296cb0ab9eba3d65955d5ea.zip |
'coroutine.close'/'lua_resetthread' report original errors
Besides errors in closing methods, 'coroutine.close' and
'lua_resetthread' also consider the original error that stopped the
thread, if any.
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/manual/manual.of b/manual/manual.of index 771bace0..164e359a 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -4098,10 +4098,12 @@ and then pops the top element. | |||
4098 | Resets a thread, cleaning its call stack and closing all pending | 4098 | Resets a thread, cleaning its call stack and closing all pending |
4099 | to-be-closed variables. | 4099 | to-be-closed variables. |
4100 | Returns a status code: | 4100 | Returns a status code: |
4101 | @Lid{LUA_OK} for no errors in closing methods, | 4101 | @Lid{LUA_OK} for no errors in the thread |
4102 | (either the original error that stopped the thread or | ||
4103 | errors in closing methods), | ||
4102 | or an error status otherwise. | 4104 | or an error status otherwise. |
4103 | In case of error, | 4105 | In case of error, |
4104 | leaves the error object on the top of the stack, | 4106 | leaves the error object on the top of the stack. |
4105 | 4107 | ||
4106 | } | 4108 | } |
4107 | 4109 | ||
@@ -6577,7 +6579,9 @@ that is, | |||
6577 | closes all its pending to-be-closed variables | 6579 | closes all its pending to-be-closed variables |
6578 | and puts the coroutine in a dead state. | 6580 | and puts the coroutine in a dead state. |
6579 | The given coroutine must be dead or suspended. | 6581 | The given coroutine must be dead or suspended. |
6580 | In case of error closing some variable, | 6582 | In case of error |
6583 | (either the original error that stopped the coroutine or | ||
6584 | errors in closing methods), | ||
6581 | returns @false plus the error object; | 6585 | returns @false plus the error object; |
6582 | otherwise returns @true. | 6586 | otherwise returns @true. |
6583 | 6587 | ||