This throws an exception for error cases. Handle that.