Update validate function to throw error if validation fails. Update onRepo function to throw error if no data is found. Provided comments throughout code.