Rescue several types of errors and send the error message to the CLI
Linked CLI task
When RuntimeError, TypeError, NameError, ArgumentError, SyntaxError are raised, the error message is returned as json.