From 7c1df8a7cd4271309160abfd28fb8011a3fee46f Mon Sep 17 00:00:00 2001 From: mpeterv Date: Tue, 16 Feb 2016 11:44:02 +0300 Subject: [PATCH] Update HTML docs for try/protect --- doc/socket.html | 15 +++++---------- 1 file 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, returns nil followed by an error message.

-

-Note: Beware that if your function performs some illegal operation that -raises an error, the protected function will catch the error and return it -as a string. This is because the try function -uses errors as the mechanism to throw exceptions. -

-

@@ -424,8 +417,7 @@ socket.try(ret1 [, ret2 ... retN]) Throws an exception in case of error. The exception can only be caught -by the protect function. It does not explode -into an error message. +by the protect function.

@@ -436,7 +428,10 @@ nested with try.

The function returns ret1 to retN if -ret1 is not nil. Otherwise, it calls error passing ret2. +ret1 is not nil or false. +Otherwise, it calls error passing ret2 wrapped +in a table with metatable used by protect to +distinguish exceptions from runtime errors.