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

configy: Catch and re-throw validation errors #65

Merged

Conversation

VPanteleev-S7
Copy link
Contributor

The documentation states:

If validation of individual fields is not enough and the section as
a whole needs to be validated, one can implement a void validate()
const method which throws an exception in the even of a validation
failure. The library will rethrow this Exception with the
file/line information pointing to the section itself, and not any
individual field.

The emphasized section was not actually implemented - exceptions thrown from validate() functions bubbled up to the top level and were printed without any context.

Fix this by implementing the functionality.

The documentation states:

> If validation of individual fields is not enough and the section as
> a whole needs to be validated, one can implement a void validate()
> const method which throws an exception in the even of a validation
> failure. **The library will rethrow this Exception with the
> file/line information pointing to the section itself, and not any
> individual field.**

The emphasized section was not actually implemented - exceptions
thrown from validate() functions bubbled up to the top level and were
printed without any context.

Fix this by implementing the functionality.
@Geod24 Geod24 merged commit 0c7a2d7 into dlang-community:v2.x.x Jan 18, 2025
1 check 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.

2 participants