Normally, if a script errors inside of pcall, the error isn’t displayed in the output. For instance:
pcall(function()
pprint()
end)
However, if not enclosed in a pcall, the following error would occur from pprint()
One would expect that the “Place has to be opened wit Edit button to access DataStores” error would not be displayed to the output if enclosed in a pcall, similar to any other error; however, this isn’t the case. Regardless of whether a datastore is accessed from within a pcall or not, the denial of access error is displayed in the output.
pcall(function()
game:service("DataStoreService"):GetDataStore("Test")
end)
game:service("DataStoreService"):GetDataStore("Test")
This isn’t just the case in the command bar. If executed from a script within a pcall, the denial of access error is still displayed in the output. The error also does not stop the script, display which script tried to access a datastore, nor communicate which line the datastore was accessed from. This error should be switched over to the standard erroring conventions that every other error uses.
If you’re curious as to why I would need to test whether or not the datastore is accessible or not, I have a fake datastore service (module) for when I can’t access the real datastore service so I don’t have to go into Play mode to test its functionality.