#how do i detect httpservice:postasync() failure?

1 messages · Page 1 of 1 (latest)

wintry scaffold
#

PostAsync returns the body of the response as a string. Could be your desired response or an error message. No way to really tell

If you want more details, like a response code, you'd need to use RequestAsync that requires more setup

vestal frost
#

you could use pcall

#

so
local s,e =pcall(function() return httpservice:PostAsync() end) if not s then print(e) end

pale zodiac
vestal frost
pale zodiac
wintry scaffold
pale zodiac
#

it is 429 i think

wintry scaffold
# pale zodiac it is 429 i think

That means you're sending too many requests to the server at that URL. Most servers don't like having too many requests from one computer, so it limits it.

pale zodiac
#

but it should still work if pcall right?

wintry scaffold
# pale zodiac but it should still work if pcall right?

Nope.

The pcall catches the error in sending it, like the function itself doesn't return any runtime errors.

The error you received is a network error, which Roblox doesn't consider an error (as the request still reached the destination and was processed)