Add exception handling in ReplCommand.ExecuteLine

To avoid infinite iterations in tests exceptions are used to stop Repl
execution.