validate container loader fn argument and error if invalid