Pcall() doesn't catch errors when testing Roblox Studio on Mac

When running Studio on certain Apple Products, pcalls simply do not catch errors and effectively destroy the entire test session. The most common example of this that I come across is with code that looks like this:

local success, errMsg = pcall(function()
    StarterGui:SetCore("ResetButtonCallback", false)
end)

Instead of catching an error if it fails to run, it interrupts the entire testing session without the ability to continue through scripts.

I’m currently on a Macbook Pro with the M4 Chip, but this exact error has been consistent across other Apple Silicon laptops. This issue occurs when testing solo or with a local server in both Server and Client RunContexts.

Demonstration
Here’s some code to quickly demonstrate this bug.

-- ServerScriptService.Script --
local success = pcall(function()
	error('Did Not Catch Error')
end)

if not success then
	error('Caught Error')
end

Here, we should never see the console error with “Did Not Catch Error”. We should only ever see the console error with “Caught Error” as the pcall should catch this and my error handling below errors with the second error. When I test it on my device, I receive only the first error, “Did Not Catch Error”, with the traceback pointing to the pcall function and the error line within it. This happens consistently. I have also tried uninstalling and reinstalling Studio in the past despite it being an issue across multiple devices.

Expected behavior

I expect the pcall to catch the error internally and expose that through the success variable, that way I can code in my own error handling. Instead, it errors immediately from within the pcall and none of the error handling code is ever reached.

2 Likes

+1, just had this issue and it was driving me crazy LOL

2 Likes

Hi crock,
From what I understand, this actually looks like an issue with the debug exception handling settings.
When you go into Test->Debug Error-> set to Never, do you still run into this error? When this is set to “On All Exceptions”, you will stop execution inside a pcall, even if the error is inside a pcall.
Does this resolve your issue, or are you referring to something else?

Thanks,
IcyTides

2 Likes

Oh, was this a new thing? I don’t remember clicking on this

It’s actually been around for a long time (It’s moved around with the recent Ribbon updates). Did this resolve your issue?

Yes for me it did resolve thank you!!

1 Like

It seems to have solved it for me as well. I’ve exclusively experienced this issue on mac and I haven’t ever messed with these settings, yet I’ve experienced this issue across multiple devices, even on different accounts. I have never experienced it on any non-mac devices. Is this a default setting, even just on mac?

The default is to never stop execution, so I’m not sure how your setting got changed. It’s also not something that’s exclusive to Mac. I’m honestly not sure, but once you’ve set it back to Never, it shouldn’t change back.

1 Like