better error handling in extract_for_partition_layout