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

Introduce a new method to validate schema that throws #77

Merged
merged 3 commits into from
Mar 6, 2025
Merged

Conversation

JuliaSamartseva
Copy link
Collaborator

No description provided.

@garanj
Copy link
Collaborator

garanj commented Mar 4, 2025

Maybe bump the version in build.gradle?

@JuliaSamartseva JuliaSamartseva changed the title Introduce a new method to validate schema that throws in case schema can't be created Introduce a new method to validate schema that throws Mar 6, 2025
public boolean validateOrThrow(Document xmlDocument, String version)
throws WatchFaceFormatValidationException {
if (!isSupportedVersion(version)) {
Log.e("Validator not support the version #" + version);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log.e("Validator does not support version #" + version);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

resourceManager.getXsdFile(version).getCanonicalPath(), new DOMSource(xmlDocument));
return true;
} catch (SAXException | IOException e) {
Log.e(e.getMessage());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log.e("Could not validate xml", e);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@JuliaSamartseva JuliaSamartseva merged commit 1b4ed2d into main Mar 6, 2025
4 checks passed
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.

4 participants