I like this much better than the version you had before, but would probably err on the side of keeping the REPL example shorter rather than being super exhaustive about the edge case error handling.  This is another spot where it might be nice to get another opinion, though.