Properly reporting errors is very important since lots of times users will enter code with errors. Specifically:
detect syntax errors and report a precise error message, along with the line / column number info about where the error occurred, so that frontend can report to user
report runtime errors and exceptions with the proper error messages / backtraces / etc. to help the user debug
[optional] if the user's code runs for too long or too many steps, report partial results and an error message (although the backend executor can also handle timeouts, albeit at a coarser-grained level)
Properly reporting errors is very important since lots of times users will enter code with errors. Specifically: