Skip to content

Adding exception interfaces #22

Description

@moufmouf

While working on definition-interop implementation, I found 2 places where exceptions could potentially be triggered:

  • DefinitionProviderInterface might send back objects that are not one of the valid definitions (for instance, it might return a stdClass. In this case, we might want to throw a InvalidDefinition exception.
  • while passing arguments to a definition, arguments passed could also be invalid (for instance, we could pass a stdClass to the MethodCall::addArgument method, which is invalid too. In this case, we might want to throw a InvalidArgument exception.

These could be simple empty interfaces:

interface DefinitionException {
}
interface InvalidDefinition extends DefinitionException {
}
interface InvalidArgument extends DefinitionException {
}

Shall I write a PR for this?
If yes, I'll also have to modify the unit test to test for these interfaces.

Also, what about the naming? Sall I suffix those with "Exception"? Or even worse, with ExceptionInterface? :) ... mmmm.... suffixes :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions