aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormpeterv <mpeterval@gmail.com>2016-02-16 11:44:02 +0300
committerPhilipp Janda <siffiejoe@gmx.net>2016-02-21 12:10:25 +0100
commit7c1df8a7cd4271309160abfd28fb8011a3fee46f (patch)
tree7d6f10850dcd9884549fa98c83f1a7706a73cbfd
parentfb713cdedb16f8eb67523f17b0d66262b4e9dca1 (diff)
downloadluasocket-7c1df8a7cd4271309160abfd28fb8011a3fee46f.tar.gz
luasocket-7c1df8a7cd4271309160abfd28fb8011a3fee46f.tar.bz2
luasocket-7c1df8a7cd4271309160abfd28fb8011a3fee46f.zip
Update HTML docs for try/protect
-rw-r--r--doc/socket.html15
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,
220returns <tt><b>nil</b></tt> followed by an error message. 220returns <tt><b>nil</b></tt> followed by an error message.
221</p> 221</p>
222 222
223<p class=note>
224Note: Beware that if your function performs some illegal operation that
225raises an error, the protected function will catch the error and return it
226as a string. This is because the <a href=#try><tt>try</tt></a> function
227uses 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>
426Throws an exception in case of error. The exception can only be caught 419Throws an exception in case of error. The exception can only be caught
427by the <a href=#protect><tt>protect</tt></a> function. It does not explode 420by the <a href=#protect><tt>protect</tt></a> function.
428into 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>
438The function returns <tt>ret</tt><sub>1</sub> to <tt>ret</tt><sub>N</sub> if 430The 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>.
432Otherwise, it calls <tt>error</tt> passing <tt>ret</tt><sub>2</sub> wrapped
433in a table with metatable used by <a href=#protect><tt>protect</tt></a> to
434distinguish exceptions from runtime errors.
440</p> 435</p>
441 436
442<pre class=example> 437<pre class=example>