Skip to content

Improve error message when adding the wrong value to a property that accepts several different kinds of linked/embedded types #199

Description

@ehennestad

Example: Adding a string to the memberOf property of the Affiliation

openminds.core.Affiliation('memberOf', 'test')

Fails with error saying value should be of type openminds.internal.mixedtype.affiliation.MemberOf.

Error using [openminds.core.actors.Affiliation
 openminds.core.Affiliation('memberOf', 'test')
                                        ^^^^^^
Invalid value for 'memberOf' argument. Value must be openminds.internal.mixedtype.affiliation.MemberOf or be convertible to openminds.internal.mixedtype.affiliation.MemberOf.

This is an internal container. The error message should list the actual allowed types, i.e.,

  • openminds.core.actors.Consortium
  • openminds.core.actors.Organization

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