diff options
author | mpeterv <mpeterval@gmail.com> | 2016-02-16 11:44:02 +0300 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2016-02-21 12:10:25 +0100 |
commit | 7c1df8a7cd4271309160abfd28fb8011a3fee46f (patch) | |
tree | 7d6f10850dcd9884549fa98c83f1a7706a73cbfd | |
parent | fb713cdedb16f8eb67523f17b0d66262b4e9dca1 (diff) | |
download | luasocket-7c1df8a7cd4271309160abfd28fb8011a3fee46f.tar.gz luasocket-7c1df8a7cd4271309160abfd28fb8011a3fee46f.tar.bz2 luasocket-7c1df8a7cd4271309160abfd28fb8011a3fee46f.zip |
Update HTML docs for try/protect
-rw-r--r-- | doc/socket.html | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/doc/socket.html b/doc/socket.html index 8a81414..a43a208 100644 --- a/doc/socket.html +++ b/doc/socket.html | |||
@@ -220,13 +220,6 @@ Returns an equivalent function that instead of throwing exceptions, | |||
220 | returns <tt><b>nil</b></tt> followed by an error message. | 220 | returns <tt><b>nil</b></tt> followed by an error message. |
221 | </p> | 221 | </p> |
222 | 222 | ||
223 | <p class=note> | ||
224 | Note: Beware that if your function performs some illegal operation that | ||
225 | raises an error, the protected function will catch the error and return it | ||
226 | as a string. This is because the <a href=#try><tt>try</tt></a> function | ||
227 | uses errors as the mechanism to throw exceptions. | ||
228 | </p> | ||
229 | |||
230 | <!-- select +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 223 | <!-- select +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
231 | 224 | ||
232 | <p class=name id=select> | 225 | <p class=name id=select> |
@@ -424,8 +417,7 @@ socket.<b>try(</b>ret<sub>1</sub> [, ret<sub>2</sub> ... ret<sub>N</sub>]<b>)</b | |||
424 | 417 | ||
425 | <p class=description> | 418 | <p class=description> |
426 | Throws an exception in case of error. The exception can only be caught | 419 | Throws an exception in case of error. The exception can only be caught |
427 | by the <a href=#protect><tt>protect</tt></a> function. It does not explode | 420 | by the <a href=#protect><tt>protect</tt></a> function. |
428 | into an error message. | ||
429 | </p> | 421 | </p> |
430 | 422 | ||
431 | <p class=parameters> | 423 | <p class=parameters> |
@@ -436,7 +428,10 @@ nested with <tt>try</tt>. | |||
436 | 428 | ||
437 | <p class=return> | 429 | <p class=return> |
438 | The function returns <tt>ret</tt><sub>1</sub> to <tt>ret</tt><sub>N</sub> if | 430 | The function returns <tt>ret</tt><sub>1</sub> to <tt>ret</tt><sub>N</sub> if |
439 | <tt>ret</tt><sub>1</sub> is not <tt><b>nil</b></tt>. Otherwise, it calls <tt>error</tt> passing <tt>ret</tt><sub>2</sub>. | 431 | <tt>ret</tt><sub>1</sub> is not <tt><b>nil</b></tt> or <tt><b>false</b></tt>. |
432 | Otherwise, it calls <tt>error</tt> passing <tt>ret</tt><sub>2</sub> wrapped | ||
433 | in a table with metatable used by <a href=#protect><tt>protect</tt></a> to | ||
434 | distinguish exceptions from runtime errors. | ||
440 | </p> | 435 | </p> |
441 | 436 | ||
442 | <pre class=example> | 437 | <pre class=example> |