Detecting data store warning

So im trying to detect when the data store queue fills (im sure we’re all familiar with this image image ) I will be using this warning in the client to inform the person requesting data that the queue has filled instead of a simple server side console error that the player cannot see.

I would like to know the best/Most efficient way to detect when this happens, and catch the warning.

example:

--typically using a pcall you can catch and error and send it if wanted
local s, m = pcall(function()
	
	Code that produces error here
	
end)

if m then
	
	event:FireClient(client, m)
	
end

--now i want to know if theres a way to detect where this warning comes from for the data store so that i can do something similar.

This isn’t an error, this is just a warning stating that the request was put in a queue, and would take a bit more time than usual to complete. Another thing is that the script will yield until it either retrieved the data or errored, which you can handle from there.

yeah, I meant warning. You get the point. If the script yields how can I detect it then?

--Script yields here due to data store request overflow
--Detecting the yield (never happens because the yield prevents the script from executing this part.)

It’s supposed to detect the moment there’s a yield and send it to the client.

Here’s how you can detect warnings.

2 Likes

I mean it doesn’t look like I have much a choice. It would only be used for one simple thing anyways though.

1 Like