DataStore errors help

So I have a few questions about the possible errors associated with dataStores?

What is the best way to deal with errors thrown from dataStore requests?
Should there be a system to deal with the errors or should i just kick the player like i have seen many do?

Are there cases where an error isn’t thrown but the data returned by the request returns nil when data should exist?
Or in other words, does roblox always recognise a erroneous request or corrupt data that is returned and if not, what measures can we make to at least recognise this? (The reason for this question is I was thinking of using Discord webhooks when an error occurs to make restoring lost data easier but if there are cases where data loss occurs without throwing an error then this method wont cover those edge cases).

Just as a note I am only a few months in to scripting so apologies for any bad wording and misunderstanding of aspects of this topic. Thanks :slight_smile:

3 Likes

To recognize it, you would do a pcall. It should not cause, or have any problems. The best way to deal with errors is: Yes, you can kick the player, but you can also make getting the data or saving the data a function, and if it doesn’t work, you can just re-run the function.