Skip to content

Custom exception layer - #3

Merged
osteel merged 1 commit into
mainfrom
feature/custom-exceptions
Mar 7, 2021
Merged

Custom exception layer#3
osteel merged 1 commit into
mainfrom
feature/custom-exceptions

Conversation

@osteel

@osteel osteel commented Mar 7, 2021

Copy link
Copy Markdown
Owner

Description

This PR adds a wrapper for the underlying package's exceptions.

Motivation and context

The OpenAPI PSR-7 Validator package throws exceptions which are a chain of exceptions linked to each other via the getPrevious() method.

While there is nothing wrong with this design, when getting these exceptions during a test suite execution the actual validation error does not appear clearly.

The wrapper introduced with this PR goes up the exception chain and aggregates the error messages as a single one.

Another advantage is that the current package's users should now only expect \Osteel\OpenApi\Testing\Exceptions\ValidationException exceptions where unforeseen exception changes in the underlying package could previously occur.

@osteel osteel self-assigned this Mar 7, 2021
@osteel
osteel merged commit 0dfa181 into main Mar 7, 2021
@osteel
osteel deleted the feature/custom-exceptions branch March 7, 2021 17:58
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.

1 participant