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

Add log for missing entity when navigating to next menu #1559

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.commcare.formplayer.objects.SerializableMenuSession;
import org.commcare.formplayer.session.MenuSession;
import org.commcare.session.CommCareSession;
import org.commcare.suite.model.EntityDatum;
import org.commcare.session.SessionFrame;
import org.commcare.suite.model.EntityDatum;
import org.commcare.suite.model.MenuDisplayable;
Expand Down Expand Up @@ -305,8 +306,12 @@
String referencesString = String.join(",\n ", refsList);
String nodeSetString = ((EntityDatum) neededDatum).getNodeset().toString();

throw new CommCareSessionException(String.format("Could not get %s=%s from entity screen.\nNode set: %s\nReferences: \n[%s]",
neededDatum.getDataId(), step.getValue(), nodeSetString, referencesString));
String error_message = String.format("Could not get %s=%s from entity screen.\nNode set: %s\nReferences: \n[%s]",
neededDatum.getDataId(), step.getValue(), nodeSetString, referencesString);

Check warning on line 310 in src/main/java/org/commcare/formplayer/services/MenuSessionFactory.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/commcare/formplayer/services/MenuSessionFactory.java#L309-L310

Added lines #L309 - L310 were not covered by tests

log.error(error_message);

Check warning on line 312 in src/main/java/org/commcare/formplayer/services/MenuSessionFactory.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/commcare/formplayer/services/MenuSessionFactory.java#L312

Added line #L312 was not covered by tests

throw new CommCareSessionException(error_message);

Check warning on line 314 in src/main/java/org/commcare/formplayer/services/MenuSessionFactory.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/commcare/formplayer/services/MenuSessionFactory.java#L314

Added line #L314 was not covered by tests

}
}
Loading