This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
Improve OpMatchingException error messages - #24
Merged
Merged
Conversation
gselzer
force-pushed
the
scijava/scijava-ops/improve-errors
branch
3 times, most recently
from
June 9, 2021 16:08
af4bb4f to
157a4da
Compare
This allows us to be more clear about the dependency chain that was not able to be matched
gselzer
force-pushed
the
scijava/scijava-ops/improve-errors
branch
from
June 9, 2021 16:11
157a4da to
1f357a5
Compare
hinerm
marked this pull request as ready for review
June 9, 2021 16:18
hinerm
added a commit
that referenced
this pull request
Jun 16, 2021
This PR improves the error messages resulting from Op matching, making it easier to tune Op requests. Current improvements focus in two areas * Identifying when two Ops conflict over a particular Op request. OpMatchingExceptions now describe all Ops that fully satisfy the request. * Clearly identifying when an Op was not provided due to the unavailability of an OpDependency. A new class, DependencyMatchingException, was created to chain the errors resulting from a failing dependency. DependencyMatchingException.getMessage() will return a String combining its own message with the messages of DependencyMatchingExceptions that are (super)causes of the returned exception. This helps users recognize that the problem does not lie with the requested Op, but instead lies with one of that Op's dependencies. An example message, describing an Op test.dependentOp that depends on test.missingDependencyOp, which in turn depends on test.nonexistingOp, is included below: See #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the error messages resulting from Op matching, making it easier to tune Op requests. Current improvements focus in two areas
OpMatchingExceptions now describe all Ops that fully satisfy the request.OpDependency. A new class,DependencyMatchingException, was created to chain the errors resulting from a failing dependency.DependencyMatchingException.getMessage()will return aStringcombining its own message with the messages ofDependencyMatchingExceptions that are (super)causes of the returned exception. This helps users recognize that the problem does not lie with the requested Op, but instead lies with one of that Op's dependencies. An example message, describing an Optest.dependentOpthat depends ontest.missingDependencyOp, which in turn depends ontest.nonexistingOp, is included below:TODO:
OpMatchingExceptions more informational (such as describing the set of parameters that prevented anOpReffrom matching a particularOpInfo. This might be difficult, however, asDefaultMatchingServicedoes not really provide us with the flexibility to report this information. It would thus require significant change. This information could also become overwhelming (think, for example, of the overwhelming number of failures upon requesting someFunction<X , X> create) to the point where it could cause more confusion than good.