As a Roblox developer, it is currently too hard to find places in code that do not handle functions that can throw.
Lua does not require that we handle errors, even though there should always be some method that handles errors. Occasionally, I will write a method (function) that can throw an error, and I will call said function without putting a pcall/xpcall around it. This can result in code throwing an error which is not handled, and will eventually have to be fixed. This becomes especially difficult to track down when there are roblox API methods that can throw an error. After all, there are only certain occasions where errors are thrown, and they often go unhandled in most Roblox developer’s code.
What I propose is that if a function can throw (i.e. contains
error()), and whatever calls it is not put inside of a pcall/xpcall/etc, the Script Analysis will show a warning that reads something like:
If Roblox is able to address this issue, it would improve my development experience because it would enable me to more easily find blocks of code that do not properly handle errors, without relying on somebody encountering an error during bug testing.