|
Post by hoanglenin on Aug 3, 2022 1:48:10 GMT
I use 2 methods httpGet() and HttpPost(), if the connection is too poor, it will give an error causing the script to stop. Is there any solution to this problem? I have reference setHttpTimeout(), What if it is still not able to connect after the time runs out?
|
|
|
Post by AnkuLua on Aug 3, 2022 7:35:57 GMT
Use pcall to handle the exception.
work, result = pcall(httpGet, "https://....") if (not work) then -- handle the exception
else -- httpGet work, handle the result
end
|
|
|
Post by hoanglenin on Aug 4, 2022 8:15:14 GMT
Use pcall to handle the exception. work, result = pcall(httpGet, "https://....") if (not work) then -- handle the exception else -- httpGet work, handle the result end Thank Admin! now it works better!
|
|