In a case of errors methods throw exceptions, if otherwise not stated. An uncaught exception causes a script to be aborted, if this is not what you want, caught it by using .
Example:
require "network"
--network.connect( {} ) would cause the script to be aborted
op_res, result = pcall( network.connect, {} )
if not op_res then
print( "fail to connect by some local reason: " .. result )
else
print( "wait till a remote side accepts our request for connection, conn_hndl: " .. result )
end
How can we help?
A premium WordPress theme with integrated Knowledge Base,
providing 24/7 community based support.