I’m very confused. Isn’t error("") supposed to print a red message to console?
This just doesn’t do anything. “A” gets printed and the thread stops running when error() is called but the error message I want to be printed isn’t printed.
I’m very confused. Isn’t error("") supposed to print a red message to console?
This just doesn’t do anything. “A” gets printed and the thread stops running when error() is called but the error message I want to be printed isn’t printed.
error() is made to stop the execution and report a specific issue, such as if you don’t intend to have a different type for a specific item as you’ve shown.
I’d usually avoid using it without pcall().
yes, thats what I want it to do. But it doesn’t print the error message to console like it should. It just stops the execution and doesn’t print the error message.
woops i found the solution
… it was in a pcall
If you’d like to error and continue the thread. Spawn the piece of code. This will execute the code without interrupting the current thread.
I’m on mobile so this is psuedo code
—code here
spawn(function()
error(“error”)
end)
—code here
thank u!
That helps because I have a large chunk of code pcall’d due to being in a loop, but it helps to be able to see the exact line(s) that an error occurs on
No problem. Please mark your thread as fixed if your problem has been fixed.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.