rojo-rbx / run-in-roblox

Run a place, model, or individual script inside Roblox Studio, integrating with command line tools
MIT License
53 stars 22 forks source link

Use `ScriptContext.Error` to filter out unrelated error messages #26

Open osyrisrblx opened 2 years ago

osyrisrblx commented 2 years ago

Currently, run-in-roblox uses LogService.MessageOut and will set the exit code to 1 if the messageType == Enum.MessageType.MessageError. However, occasionally Studio will report internal Roblox errors like "Studio beta features failed to fetch". This will cause run-in-roblox to exit with a status code of 1 even if none of the user code had an error.

Instead, maybe run-in-roblox should use ScriptContext.Error to determine the status code and continue to use LogService.MessageOut for logging. ScriptContext.Error provides a reference to the script that errored.

We can probably safely ignore any script errors from outside common services like:

Dionysusnu commented 2 years ago

Run-in-roblox knows the script to run from the command-line argument. Is it reasonably possible to figure out if errors originate from that callstack?