handle errors from rs.realpath()