Skip to content

Commit ff0cefc

Browse files
authored
Symptom fix (#150)
* add error logs for invalid symptom inputs * SymptomInputsManager.kt: copy/pase errors fixed * Cargo.toml: version, authors update
1 parent 663c4f9 commit ff0cefc

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "coepi_core"
3-
version = "0.1.0"
4-
authors = ["theseriousadult <[email protected]>, ivanschuetz <[email protected]>"]
3+
version = "0.1.35"
4+
authors = ["theseriousadult <[email protected]>, ivanschuetz <[email protected]>, duskoo <[email protected]>"]
55
edition = "2018"
66

77
[lib]

android/core/core/src/main/java/org/coepi/core/services/SymptomInputsManager.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SymptomInputsManagerImpl(private val api: JniApi, private val gson: Gson)
7777
}.asResult()
7878

7979
override fun setCoughStatus(input: UserInput<Cough.Status>): Result<Unit, Throwable> =
80-
api.setCoughType(
80+
api.setCoughStatus(
8181
input.toJniStringInput {
8282
when (it) {
8383
BETTER_AND_WORSE_THROUGH_DAY -> "better_and_worse"
@@ -113,7 +113,7 @@ class SymptomInputsManagerImpl(private val api: JniApi, private val gson: Gson)
113113
}
114114

115115
override fun setFeverTakenTemperatureSpot(input: UserInput<Fever.TemperatureSpot>): Result<Unit, Throwable> =
116-
api.setCoughType(
116+
api.setFeverTakenTemperatureSpot(
117117
input.toJniStringInput {
118118
when (it) {
119119
is Armpit -> "armpit"

src/reporting/symptom_inputs_manager.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ where
9393
"none" => UserInput::None,
9494
"wet" => UserInput::Some(CoughType::Wet),
9595
"dry" => UserInput::Some(CoughType::Dry),
96-
_ => Err(format!("Not supported: {}", cough_type))?,
96+
_ => {
97+
error!("Not supported cough type: {}", cough_type);
98+
Err(format!("Not supported cough type: {}", cough_type))?
99+
}
97100
};
98101

99102
debug!("Setting cough type: {:?}", input);
@@ -120,7 +123,10 @@ where
120123
"better_and_worse" => UserInput::Some(CoughStatus::BetterAndWorseThroughDay),
121124
"same_steadily_worse" => UserInput::Some(CoughStatus::SameOrSteadilyWorse),
122125
"worse_outside" => UserInput::Some(CoughStatus::WorseWhenOutside),
123-
_ => Err(format!("Not supported: {}", status))?,
126+
_ => {
127+
error!("Not supported cough status: {}", status);
128+
Err(format!("Not supported cough status: {}", status))?
129+
}
124130
};
125131

126132
debug!("Setting cough status: {:?}", input);
@@ -141,7 +147,10 @@ where
141147
}
142148
"ground_own_pace" => UserInput::Some(BreathlessnessCause::GroundOwnPace),
143149
"hurry_or_hill" => UserInput::Some(BreathlessnessCause::HurryOrHill),
144-
_ => Err(format!("Not supported: {}", cause))?,
150+
_ => {
151+
error!("Not supported breathlessness cause: {}", cause);
152+
Err(format!("Not supported breathlessness cause: {}", cause))?
153+
}
145154
};
146155

147156
debug!("Setting breathlessness cause: {:?}", input);
@@ -185,7 +194,10 @@ where
185194
"ear" => UserInput::Some(TemperatureSpot::Ear),
186195
"mouth" => UserInput::Some(TemperatureSpot::Mouth),
187196
"other" => UserInput::Some(TemperatureSpot::Other),
188-
_ => Err(format!("Not supported: {}", spot))?,
197+
_ => {
198+
error!("Not supported temperature spot: {}", spot);
199+
Err(format!("Not supported temperature spot: {}", spot))?
200+
}
189201
};
190202

191203
debug!("Setting fever temperature spot: {:?}", input);

0 commit comments

Comments
 (0)