ls.rs: improve error handling.