Add error handling in the repl.