Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific Upload Error Handling #51

Merged
merged 4 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions PAWS/PAWSStandard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,21 @@
do {
try await upload(sample: electrocardiogram)

supplementalMetrics.append(contentsOf: try await electrocardiogram.precedingPulseRates)
supplementalMetrics.append(contentsOf: try await electrocardiogram.precedingPhysicalEffort)
supplementalMetrics.append(contentsOf: try await electrocardiogram.precedingStepCount)
supplementalMetrics.append(contentsOf: try await electrocardiogram.precedingActiveEnergy)
supplementalMetrics.append(contentsOf: (try? await electrocardiogram.precedingPulseRates) ?? [])
supplementalMetrics.append(contentsOf: (try? await electrocardiogram.precedingPhysicalEffort) ?? [])
supplementalMetrics.append(contentsOf: (try? await electrocardiogram.precedingStepCount) ?? [])
supplementalMetrics.append(contentsOf: (try? await electrocardiogram.precedingActiveEnergy) ?? [])

Check warning on line 91 in PAWS/PAWSStandard.swift

View check run for this annotation

Codecov / codecov/patch

PAWS/PAWSStandard.swift#L88-L91

Added lines #L88 - L91 were not covered by tests

if let precedingVo2Max = try await electrocardiogram.precedingVo2Max {
if let precedingVo2Max = try? await electrocardiogram.precedingVo2Max {

Check warning on line 93 in PAWS/PAWSStandard.swift

View check run for this annotation

Codecov / codecov/patch

PAWS/PAWSStandard.swift#L93

Added line #L93 was not covered by tests
supplementalMetrics.append(precedingVo2Max)
}

for supplementalMetric in supplementalMetrics {
try await upload(sample: supplementalMetric)
do {
try await upload(sample: supplementalMetric)
} catch {
logger.log("Could not upload \(supplementalMetric.sampleType): \(error)")
}

Check warning on line 102 in PAWS/PAWSStandard.swift

View check run for this annotation

Codecov / codecov/patch

PAWS/PAWSStandard.swift#L98-L102

Added lines #L98 - L102 were not covered by tests
}
} catch {
logger.log("Could not access HealthKit sample: \(error)")
Expand Down
Loading