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

Improve error messages about datasets #999

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

ktuite
Copy link
Member

@ktuite ktuite commented Sep 19, 2023

Closes getodk/central#487

This PR makes slight changes to the error messages coming from Backend about problems parsing form XML containing entity definitions.

Screen Shot 2023-09-19 at 4 27 50 PM

There is a somewhat generic message for entity form parsing problems that says "The entity definition within the form is invalid" followed by a reason more specific to the problem, e.g. what we were seeing before with "Invalid Dataset property." Both parts get passed through to Frontend. I'm not sure localization makes the most sense here because the problem was with reason and we probably don't want to maintain translations for all possible reasons for this one case, especially since they are all within the same problem code.

For this one case about "dataset property", it was easy to change it to "entity property", even within the world of still referring to datasets as datasets in the backend.

For other cases, like problems that mention "invalid dataset name", the error message should actually stay as it is because this only happens for XML parsing (pyxform will catch other errors upstream) and in that case, the field is still called "dataset" within the XML. The other problems that still mention "dataset" are also like this -- they are about the value of "dataset" within XML.

What has been done to verify that this works as intended?

Tests, trying it.

Why is this the best possible solution? Were any other approaches considered?

See reasoning above

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Doesn't change much but hopefully makes this edge case a little less confusing.

Does this change require updates to the API documentation? If so, please update docs/api.md as part of this PR.

No

Before submitting this PR, please make sure you have:

  • run make test-full and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@matthew-white matthew-white merged commit 0b1272f into master Sep 20, 2023
5 checks passed
@matthew-white matthew-white deleted the ktuite/entity-error-messages branch September 20, 2023 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Invalid Dataset property" error message to be updated?
2 participants