Throw error when class config is wrong.