Skip to content

Change recoverable errors to validation errors instead of schema definition warnings#863

Merged
stevedlawrence merged 1 commit into
apache:mainfrom
stevedlawrence:daffodil-2357-recoverable-error-validation
Oct 24, 2022
Merged

Change recoverable errors to validation errors instead of schema definition warnings#863
stevedlawrence merged 1 commit into
apache:mainfrom
stevedlawrence:daffodil-2357-recoverable-error-validation

Conversation

@stevedlawrence
Copy link
Copy Markdown
Member

A dfdl:assert with failureType="recoverableError" is currently treated as a schema definition warning. However, SDW's are usually for things that can be safely ignored, and these asserts are generally used for validation checking beyond the capabilities of XSD that should not be ignored, or should at least be treated differently so that a user can easily differentiate between the two.

This modifiers these asserts so that the errors are turned validation errors accessible just like those created when validation is turned on. This also refactors the handling of errors to avoid duplication between assert expressions and assert patterns, as well as changes to make error messages consistent.

Note that this is backwards incompatible change, but is arguably the more correct behavior since these asserts really are predominantly used for extended validation checks.

DAFFODIL-2357

Copy link
Copy Markdown
Contributor

@olabusayoT olabusayoT left a comment

Choose a reason for hiding this comment

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

Looks great! +1

Copy link
Copy Markdown
Contributor

@tuxji tuxji left a comment

Choose a reason for hiding this comment

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

+1

Agreed.

…nition warnings

A dfdl:assert with failureType="recoverableError" currently results in a
schema definition warning. However, SDW's are usually used for things
that can be safely ignored, while these asserts are generally used for
validation checking beyond the capabilities of XSD that should not be
ignored, or should at least be treated differently than warnings so that
a user can easily differentiate between the two.

This modifies these recoverable errors to become validation errors,
accessible just like those created when validation is turned on. This
also refactors the handling of errors to avoid duplication between
assert expressions and assert patterns, as well as changes to make error
messages more consistent.

Note that this is a non-backwards compatible change, but is arguably the
more correct behavior since these asserts really are predominantly used
for more complex validation checks.

DAFFODIL-2357
@stevedlawrence stevedlawrence force-pushed the daffodil-2357-recoverable-error-validation branch from e8d0c79 to 2aed244 Compare October 24, 2022 19:16
@stevedlawrence stevedlawrence merged commit 39cc88c into apache:main Oct 24, 2022
@stevedlawrence stevedlawrence deleted the daffodil-2357-recoverable-error-validation branch October 24, 2022 19:16
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.

3 participants