error handling in repl