How to suppress console errors?

I know in java you can suppress errors that don’t really make a big deal, for example, you do

@SupressWarnings

Is there a feature in lua too? I keep on getting this weird error about player assets and one of the decals on the player’s head isn’t loading, but i think it might be their fault for choosing a moderated avatar but regardless its flooding dev console.

You could only use pcall, although you can’t really pcall errors about loading failures, in the dev console there is a way to filter warnings, errors etc, so I wouldn’t worry too much.

Those errors (along with infinite yield warnings) usually come from corescripts, so you can’t really do anything about it. You can hide errors, but this is problematic because your scripts’ errors won’t show up.

If these are actually your scripts, you can either pcall them, or maybe run them in a separate thread, coroutine.create(), since it silences errors.

2 Likes