95 posts
Location
Somewhere near the local computer store?
Posted 11 December 2012 - 12:19 PM
How do i create a http.request event handler to not crash a program if the site is down or there is no http.
264 posts
Location
Where you aren't
Posted 11 December 2012 - 02:37 PM
if not http then
print("Please enable the HTTP API in your ComputerCraft configuration file")
break
end
95 posts
Location
Somewhere near the local computer store?
Posted 31 December 2012 - 09:25 AM
Yes, I know that checks to see if http is on. But what about if http is on and someone enters a site that doesn't exist into a CC browser (Hint: im working on one), then the program crashes when trying to go there!
2088 posts
Location
South Africa
Posted 31 December 2012 - 10:25 AM
It will return an event… http_success and http_failure..
if event == "http_failure" then
print("Unable to access website.")
end